2014-05-29, 09:10
Hi All,
I wanted to make a request to ALL addon developers. (and get your thoughts on the idea).
With users quite often having mutliple addons installed on their system, when you ask them to switch debug on in order to track down an issue, the log gets filled with ALL addons debug.
In order to prevent this, I have added some "Enable Debug" options to the settings of my addons (been there quite a while now):
VideoExtras
TvTunes
Sonos
This means that if another addon developer is trying to debug a problem they do not get the log flooded with my addon's debug as well (As this could make it hard to read - TvTunes kicks out loads of debug information!)
Can I make a request that other addon developers consider doing the same for their addons - yes the instructions for debugging an addon would now be:
1) Put System debug on
2) Put debug on in the settings of the addon
But users of TvTunes and VideoExtras have managed this without an issue - and if every addon did the same it would become second nature to the user!
http://wiki.xbmc.org/index.php?title=Add...#Debugging
As you can guess the settings change is easy, add something like:
settings.xml:
Language File (strings.po):
This string is already translated in Transfix, so should not need any more translating
Logging method:
What do people think - if people agree, then maybe we can add it as a "desired change" in the wiki?
Thanks
Rob
I wanted to make a request to ALL addon developers. (and get your thoughts on the idea).
With users quite often having mutliple addons installed on their system, when you ask them to switch debug on in order to track down an issue, the log gets filled with ALL addons debug.
In order to prevent this, I have added some "Enable Debug" options to the settings of my addons (been there quite a while now):
VideoExtras
TvTunes
Sonos
This means that if another addon developer is trying to debug a problem they do not get the log flooded with my addon's debug as well (As this could make it hard to read - TvTunes kicks out loads of debug information!)
Can I make a request that other addon developers consider doing the same for their addons - yes the instructions for debugging an addon would now be:
1) Put System debug on
2) Put debug on in the settings of the addon
But users of TvTunes and VideoExtras have managed this without an issue - and if every addon did the same it would become second nature to the user!
http://wiki.xbmc.org/index.php?title=Add...#Debugging
As you can guess the settings change is easy, add something like:
settings.xml:
Code:
<setting id="logEnabled" type="bool" label="32019" default="false"/>
Language File (strings.po):
Code:
msgctxt "#32019"
msgid "Enable debug logging"
msgstr ""
Logging method:
Code:
def log(txt, loglevel=xbmc.LOGDEBUG):
if (__addon__.getSetting( "logEnabled" ) == "true") or (loglevel != xbmc.LOGDEBUG):
if isinstance (txt,str):
txt = txt.decode("utf-8")
message = u'%s: %s' % (__addonid__, txt)
xbmc.log(msg=message.encode("utf-8"), level=loglevel)
What do people think - if people agree, then maybe we can add it as a "desired change" in the wiki?
Thanks
Rob