Kodi Community Forum

Full Version: Addon Logging Deprecation: NOTICE/SEVERE levels to be deprecated by end of June '20
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2

Recently Kodi 19 moved to using spdlog in its core. This meant a cleanup of the log levels kodi has had for many years. Both the NOTICE and SEVERE levels are now redundant and INFO and FATAL should now be used in their place respectively. Kodi will then use the following set of level for logging: DEBUG, INFO, WARNING, ERROR and FATAL.

Python addons only ever used the xbmc.LOGNOTICE level (SEVERE was never exposed in the API). Work is already underway to update the binary addons starting with PVR. The deprecated log levels have all been changed in Kodi in this PR: https://github.com/xbmc/xbmc/pull/17730.

NOTICE and SEVERE will deprecated from all APIs by the end of June.

As there are some python addons already in the matrix repo using xbmc.LOGNOTICE I will provide list of those on this thread later today.

please note that addons submitted to our repository should only use the xbmc.LOGDEBUG level.
we prefer to keep the standard kodi.log file free from all kinds of addon logging, for two reasons:
- so kodi devs can easily spot kodi issues in the log, without having to scroll through a giant amount of addon logging
- on systems where kodi runs 24/7, the logfile can grow very large very quickly if a lot of logging is done


Addons/files using this in repo-scripts:



Addons/files using this in repo-plugins:


I've fixed my two and am prepping for submission.  Thanks for letting us know about this.  Out of curiosity, will INFO be logged by default in Kodi 19 instead of NOTICE, or are we down to just WARNING, ERROR, and FATAL if we want to log something to the regular Kodi log file (i.e. without debug logging on in Kodi).  I noticed that in Kodi 18 at least, INFO is only logged when debug logging is one. It's not a huge deal, but I used to use NOTICE just to log that my addon had started and stopped so there was some little note in the log. I changed those to INFO, but obviously in Kodi 18 that now means my addons are completely silent in the log.

Yes, I know I could just change this for Kodi 19, but I'm holding onto the hope that I can keep my code the same for Kodi 18/19 (since I already did all the work to make them Python 2/3 compatible) and just update the addon.xml as needed.
Yes, that is exactly the change. INFO is the new NOTICE.

So DEBUG+all others in debug mode and only INFO, WARNING, ERROR and FATAL in normal.

You are correct on the impact, INFO would not be seen in Kodi 18.
I checked, LOGNOTICE is still in the Kodi master branch and still works:

Will LOGNOTICE eventually be completely removed in Kodi 19 and when?
Still works in kodi or from an addon?
From an addon. With this Python source code:

    xbmc.log(msg='Test 1 DEBUG', level=xbmc.LOGDEBUG)
    xbmc.log(msg='Test 2 INFO', level=xbmc.LOGINFO)
    xbmc.log(msg='Test 3 NOTICE', level=xbmc.LOGNOTICE)
    xbmc.log(msg='Test 4 WARNING', level=xbmc.LOGWARNING)
    xbmc.log(msg='Test 5 ERROR', level=xbmc.LOGERROR)
    xbmc.log(msg='Test 6 SEVERE', level=xbmc.LOGSEVERE)
    xbmc.log(msg='Test 7 FATAL', level=xbmc.LOGFATAL)

I get this output in kodi.log with Kodi 19.0-ALPHA1 (18.9.701) Git:20200823-172b25d561:

2020-08-24 19:47:48.233 T:15893    INFO <general>: Test 2 INFO
2020-08-24 19:47:48.233 T:15893    INFO <general>: Test 3 NOTICE
2020-08-24 19:47:48.233 T:15893 WARNING <general>: Test 4 WARNING
2020-08-24 19:47:48.233 T:15893   ERROR <general>: Test 5 ERROR
2020-08-24 19:47:48.233 T:15893   FATAL <general>: Test 6 SEVERE
2020-08-24 19:47:48.233 T:15893   FATAL <general>: Test 7 FATAL
Let me schedule this change and we'll get it in for Alpha2. Apologies, it should have been in for the first Alpha.
Here is the PR pertaining to removal: https://github.com/xbmc/xbmc/pull/18346

I have included the a list of the add-ons using LOGNOTICE and LOGSEVERE from both the repo-scirpts and repo-plugins matrix branches.

Anywhere else I should look @mediaminister @pkscout ?

EDIT: I plan to merge this in 2 weeks time.
@phunkyfish I think between what you listed here and the addition of the scrapers mentioned in the PR that we're fine in terms of where to look.
Great, thanks!
Okay, I get AttributeError in add-ons when using xbmc.LOGNOTICE and xbmc.LOGSEVERE with PR 18346 in Kodi 19. It's really removed now.
(2020-08-30, 16:51)mediaminister Wrote: [ -> ]Okay, I get AttributeError in add-ons when using xbmc.LOGNOTICE and xbmc.LOGSEVERE with PR 18346 in Kodi 19. It's really removed now.

Thanks for checking. I will merge the PR in about 2 weeks time.
This PR has been merged.
Can you please do a similar exercise for xbmcvfs.translatePath() move as well.
There are a few scripts still using xbmc.translatePath() in the matrix repo (for e.g. script.kodi.windows.update\default.py) which use this and is raising Deprecation messages in the log
WARNING <general>: xbmc.translatePath is deprecated and might be removed in future kodi versions. Please use xbmcvfs.translatePath instead.
Pages: 1 2