Req (All Addons) Addon Specific Debug Setting
#1
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:
Code:
    <setting id="logEnabled" type="bool" label="32019" default="false"/>

Language File (strings.po):
Code:
msgctxt "#32019"
msgid "Enable debug logging"
msgstr ""
This string is already translated in Transfix, so should not need any more translating

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
Reply
#2
already have this in Artwork Downloader for two years Smile
So yes i agree.

Maybe make it a separate tab: "Debug" with "Enable debugging"
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#3
Already doing it.

Maybe add something to the addon development wiki page?
Reply
#4
In the Artistslideshow thread, you made it sound like I'm some kind of outlier because I don't agree with you. I checked those 50+ add ons you mentioned, and 80% have no logging option or default to logging on. So it appears lots of developers (including me) are OK going through a log file with other stuff in it.

I will also say that sometimes it's the interaction between add ons that causes problems, and not having that logging information for other add ons makes it very hard to properly troubleshoot.
Reply
#5
(2014-05-29, 09:43)pkscuot Wrote: So it appears lots of developers (including me) are OK going through a log file with other stuff in it.
Not me. If i see a log full of spam I just say disable the rest or good luck. Sorry but I have no time or feel like wading through thousands of log lines.

On a side note. This is not only for add-on devs. This is about XBMC devs as well, and no one wants to see massive log spam while searching for actual issues.
So if i start seeing massive log spam defaulting to ON and getting in the way of XBCM devs, I will insist the addon dev disables it by default.

This doesn't matter for plugins as they only run once, triggered by the user. This does apply to services/programs that continue running or run by default


Quote:I will also say that sometimes it's the interaction between add ons that causes problems, and not having that logging information for other add ons makes it very hard to properly troubleshoot.
Then ask if they enable both enable them and turn back off after.
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#6
(2014-05-29, 09:43)pkscuot Wrote: So it appears lots of developers (including me) are OK going through a log file with other stuff in it.

I added a logging option as a courtesy to other devs as my addon dumps a shttnne of info into the log, and a tester or two complained about the multi-meg log files taking up space on their SD card. (Plan to fix that for the 1.0 Smile)
Reply
#7
As a non-dev Team member, all add-ons having this would make my life so much simpler.

If I see a user asking for help with something in xbmc core, perhaps a video or audio issue, then nothing turns me off more from helping out than seeing a debug log with thousands upon thousands of lines of log spam from add-ons that have absolutely no relevance to the problem. At present my only options are:

1. Ignore post and see if someone else is more willing to wade through the log.
2. Ask the user to disable the add-ons if they want my help.

I'd be perfectly ok with add-on dev's implementing this with the logging toggle still enabled as default, but please give those of us who don't want to wade through tons of log lines the option to turn logging off.
Reply
#8
OK, never mind. I just get contrarian when someone comes into a support thread, asks for something, gets it, and then complains because I didn't read their mind and do it the way they wanted. I've changed all the scripts I maintain to have logging off by default. Once I get updated language files from Transfix I'll push out updates.
Reply
#9
(2014-05-29, 10:34)jjd-uk Wrote: I'd be perfectly ok with add-on dev's implementing this with the logging toggle still enabled as default,

I am not Smile
Should be off by default. We started doing this in XBMC itself. Muting debug messages for separate core components to reduce the log spam for other devs. If user has issues he can only switch on one specific component to give a better overview.
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#10
Ideally every add-on should have full logging off as default, but if there was resistance from the dev I'd rather see the toggle being there than not all.
Reply
#11
(2014-05-29, 10:40)pkscuot Wrote: OK, never mind. I just get contrarian when someone comes into a support thread, asks for something, gets it, and then complains because I didn't read their mind and do it the way they wanted. I've changed all the scripts I maintain to have logging off by default. Once I get updated language files from Transfix I'll push out updates.

Sorry you feel that way - I was trying to be as polite as possible if you read my posts on the Artist Slideshow thread. After all switching to default off is only a single word (false -> true) in the settings.xml.

Rob
Reply
#12
(2014-05-29, 10:55)rob_webset Wrote:
(2014-05-29, 10:40)pkscuot Wrote: OK, never mind. I just get contrarian when someone comes into a support thread, asks for something, gets it, and then complains because I didn't read their mind and do it the way they wanted. I've changed all the scripts I maintain to have logging off by default. Once I get updated language files from Transfix I'll push out updates.

Sorry you feel that way - I was trying to be as polite as possible if you read my posts on the Artist Slideshow thread. After all switching to default off is only a single word (false -> true) in the settings.xml.

Rob

problem is to truly set it off by default you need to change the settings ID This is because if the ID was already set once to true you can't set it default off again without asking users to do it.
Still only a minor change
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#13
(2014-05-29, 11:00)Martijn Wrote: problem is to truly set it off by default you need to change the settings ID This is because if the ID was already set once to true you can't set it default off again without asking users to do it.
Still only a minor change

Suggestion was before official publish (Beta state - so I guess the time when suggestions like that should be made?)
Reply
#14
I next days I'll do this change in my addon

I think that even xmbc dev team must leave debug log EMPTY if log is not enable.
And actually xmbc logs a lot !
Reply
#15
(2014-05-29, 12:39)realtebo Wrote: I next days I'll do this change in my addon

Thanks.

(2014-05-29, 12:39)realtebo Wrote: I think that even xmbc dev team must leave debug log EMPTY if log is not enable.
And actually xmbc logs a lot !

I think the "Error" and "Notice" level need to always go into the log? (Maybe)
Reply

Logout Mark Read Team Forum Stats Members Help
(All Addons) Addon Specific Debug Setting0