• 1
  • 4
  • 5
  • 6(current)
  • 7
  • 8
  • 15
Your 1st Add-On: Hello World!
#76
(2015-01-26, 14:31)ruuk Wrote:
(2015-01-25, 02:04)Razze Wrote: Is there any resource on the recommended way to do logging in kodi?

One thing I find useful is to have an addon setting to enable debugging for just the addon and use LOGDEBUG unless this is enabled. I have almost never needed Kodi debugging enabled to find an issue with an addon and it generally fills the log, making it harder to find the addon's log messages.

so I if I understand you I should have a switch:

if logging in plugin settings activated:
xbmc.log("something", level=LOGDEBUG)
else:
xbmc.log("something", level=LOGNOTICE)

and isn't this against the whole point of log levels?
Reply
#77
everytime i try to edit and then zip it then through kodi open from zip it says add-on does not have the correct structure.
can someone please help, tried to look for it in forum but can not find anything specific.
thanks in advance.
Reply
#78
If you already have it installed, simply edit the files in the userdata/addons folder. Its much quicker than trying to zip it each time.
Reply
#79
(2015-01-31, 20:09)Razze Wrote:
(2015-01-26, 14:31)ruuk Wrote:
(2015-01-25, 02:04)Razze Wrote: Is there any resource on the recommended way to do logging in kodi?

One thing I find useful is to have an addon setting to enable debugging for just the addon and use LOGDEBUG unless this is enabled. I have almost never needed Kodi debugging enabled to find an issue with an addon and it generally fills the log, making it harder to find the addon's log messages.

so I if I understand you I should have a switch:

if logging in plugin settings activated:
xbmc.log("something", level=LOGDEBUG)
else:
xbmc.log("something", level=LOGNOTICE)

and isn't this against the whole point of log levels?

no else :-)

only log something if the setting is activated.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#80
(2015-02-03, 00:55)ronie Wrote:
(2015-01-31, 20:09)Razze Wrote:
(2015-01-26, 14:31)ruuk Wrote: One thing I find useful is to have an addon setting to enable debugging for just the addon and use LOGDEBUG unless this is enabled. I have almost never needed Kodi debugging enabled to find an issue with an addon and it generally fills the log, making it harder to find the addon's log messages.

so I if I understand you I should have a switch:

if logging in plugin settings activated:
xbmc.log("something", level=LOGDEBUG)
else:
xbmc.log("something", level=LOGNOTICE)

and isn't this against the whole point of log levels?

no else :-)

only log something if the setting is activated.

but thats what ruuk mentioned?
and it would probably be very confusing for most users. if you got an problem with my addon, it's really handy to have the log of kodi + addon log without the noise form all the other addons installed.
Reply
#81
(2015-02-03, 11:21)Razze Wrote:
(2015-02-03, 00:55)ronie Wrote:
(2015-01-31, 20:09)Razze Wrote: so I if I understand you I should have a switch:

if logging in plugin settings activated:
xbmc.log("something", level=LOGDEBUG)
else:
xbmc.log("something", level=LOGNOTICE)

and isn't this against the whole point of log levels?

no else :-)

only log something if the setting is activated.

but thats what ruuk mentioned?
and it would probably be very confusing for most users. if you got an problem with my addon, it's really handy to have the log of kodi + addon log without the noise form all the other addons installed.
I think ruuk meant the opposite. So you log notice instead of debug if the addon setting is enabled. If disabled you use debug.
Reply
#82
(2015-02-03, 11:28)takoi Wrote:
(2015-02-03, 11:21)Razze Wrote:
(2015-02-03, 00:55)ronie Wrote: no else :-)

only log something if the setting is activated.

but thats what ruuk mentioned?
and it would probably be very confusing for most users. if you got an problem with my addon, it's really handy to have the log of kodi + addon log without the noise form all the other addons installed.
I think ruuk meant the opposite. So you log notice instead of debug if the addon setting is enabled. If disabled you use debug.

em, yeah. I meant to write that in my pseudo code. at least I implemented it the right way in my script
Reply
#83
If anybody's interested btw, I created a config for using the standard library logging module with kodi recently. I posted a copy here: https://gist.github.com/tamland/6ca454f2d31913c5d4df

So you just do:
Code:
import logging
import xbmclogging
xbmclogging.config()

logger = logging.getLogger(__name__)
logger.error("hello log")

etc. and log lines will be correctly prefixed with addon id and logger name.
Reply
#84
(2015-02-03, 00:46)zag Wrote: If you already have it installed, simply edit the files in the userdata/addons folder. Its much quicker than trying to zip it each time.

But what do we do when we want to make the addon available to the public. My zip files come back as 'addon does not have the coRrect structure, when trying to install from a server.
If I copy the same zip file to the device and then install the zip file locally the addon installs just fine. Note this is not transferring the individual files it is installing from the same zip file that is rejected when trying to install from an offsite server.

Any ideas what problems several of us are experiencing with zip files?
Easy Home Automation to Control your RF device within Kodi XBMC
Want to watch TV everywhere you go? Pop by the Want To Watch TV site.
Image
Reply
#85
(2015-02-03, 11:28)takoi Wrote:
(2015-02-03, 11:21)Razze Wrote:
(2015-02-03, 00:55)ronie Wrote: no else :-)

only log something if the setting is activated.

but thats what ruuk mentioned?
and it would probably be very confusing for most users. if you got an problem with my addon, it's really handy to have the log of kodi + addon log without the noise form all the other addons installed.
I think ruuk meant the opposite. So you log notice instead of debug if the addon setting is enabled. If disabled you use debug.

let me try to clear things up a bit.

1) we encourage all addon devs to only use the LOGDEBUG level.
we prefer addons not to log anything to the logfile, unless debuglogging in kodi is enabled.
why? because we don't rotate logfiles and on 24/7 systems the logfile will get out of hand quickly (and possibly will fill up all diskspace) if every addon would constantly log to it.

2) adding an additional setting in the addon to enable logging is optional, but very much recommended.
why? because the kodi devs get very annoyed by all the addon logspam if they have to troubleshoot some core issue using the Debug Log file.

so the less your addon logs, the better it is.

if a user has an issue with your addon, just explain him to turn on debug logging in kodi and to enable logging in your addon.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#86
(2015-02-03, 16:40)ronie Wrote:
(2015-02-03, 11:28)takoi Wrote:
(2015-02-03, 11:21)Razze Wrote: but thats what ruuk mentioned?
and it would probably be very confusing for most users. if you got an problem with my addon, it's really handy to have the log of kodi + addon log without the noise form all the other addons installed.
I think ruuk meant the opposite. So you log notice instead of debug if the addon setting is enabled. If disabled you use debug.

let me try to clear things up a bit.

1) we encourage all addon devs to only use the LOGDEBUG level.
we prefer addons not to log anything to the logfile, unless debuglogging in kodi is enabled.
why? because we don't rotate logfiles and on 24/7 systems the logfile will get out of hand quickly (and possibly will fill up all diskspace) if every addon would constantly log to it.

2) adding an additional setting in the addon to enable logging is optional, but very much recommended.
why? because the kodi devs get very annoyed by all the addon logspam if they have to troubleshoot some core issue using the Debug Log file.

so the less your addon logs, the better it is.

if a user has an issue with your addon, just explain him to turn on debug logging in kodi and to enable logging in your addon.

1) I agree on that one.

2) there should be another why, especially for addon devs. Why? Because one addon dev might not want to see the spam of another addon if he wants to debug his.

@the less the better, definatly. Could be my mind tricking me but it seems exessive logging slows down everything.
Reply
#87
where would be the best place to add a tmdb id and/or trakt id to shows and movies?
Reply
#88
and is there a way to set the progress of an movie or episode via jsonrpc?
so that the user is questioned if he wants to resume at XX:XX when he tries to restart the movie?
Reply
#89
Those questions have nothing to do with the "hello world" add-on.

Please start a new thread.
Reply
#90
Sorry, thought these are basic questions and fit this quote from you

(2014-11-27, 19:03)zag Wrote: Feel free to ask any questions in this thread about starting to write Kodi Add-Ons Wink
Reply
  • 1
  • 4
  • 5
  • 6(current)
  • 7
  • 8
  • 15

Logout Mark Read Team Forum Stats Members Help
Your 1st Add-On: Hello World!5