Output something to xbmc.log with level NOTICE
#1
Does anyone out here know whether it's possible to log something to the xbmc.log with level NOTICE (so it also get's logged in loglevel 0) in Python. The only ones I know are "xbmc.output()" which outputs stuff at loglevel info (which only get logged in debug mode) and "xbmc.log()" which logs stuff at loglevel debug....

Thanks!
-= Team Kodi developer fueled by heavy metal =-
Reply
#2
xbmc/utils/log.h has the constants for the different log levels. You can use CLog::Log(int level, char* fmt, ...) to log at whatever level you please.

BTW, LOGNOTICE is logged at default level. Only LOGINFO and LOGDEBUG are suppressed.
Reply
#3
althekiller Wrote:xbmc/utils/log.h has the constants for the different log levels. You can use CLog::Log(int level, char* fmt, ...) to log at whatever level you please.

BTW, LOGNOTICE is logged at default level. Only LOGINFO and LOGDEBUG are suppressed.

Thanks. But how do I use this function in Python (I forgot to mention that)? Is this even possible at all?
-= Team Kodi developer fueled by heavy metal =-
Reply
#4
The only facilities in the xbmc module are as you described. output() which is LOGINFO and log() which is LOGFATAL. I'm not sure if this is intentional or an oversight during the evolution of XBMC and the module.
Reply
#5
print should output to the log also at LOGNOTICE.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#6
Nuka1195 Wrote:print should output to the log also at LOGNOTICE.

I just tried a simple:

Code:
print "test"

But I see nothing appear in the logfile unfortunately. Any other idea's?
-= Team Kodi developer fueled by heavy metal =-
Reply
#7
your right Smile

this changed back when log levels changed, so xbmc source will need fixing.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#8
Nuka1195 Wrote:your right Smile

this changed back when log levels changed, so xbmc source will need fixing.

Should I trac this? And if so, what is the proposed soluton: a function that can log strings at different loglevels or having a print that outputs to xbmc.log again?
-= Team Kodi developer fueled by heavy metal =-
Reply

Logout Mark Read Team Forum Stats Members Help
Output something to xbmc.log with level NOTICE0