Is there anyway to detect the loglevel (if debug has been set)?
#1
Since I am reading from the log to detect video framerate, I'd also like to know if the log is in debug mode so I can calculate the number of lines from the end of the log to read...

I can't seem to locate a way of detecting this in the python api, or infolabels or json api. I'm trying to avoid having to parse guisetttings.xml every time a video starts playing to see if <showloginfo> has been set to True.

Does anyone know a way of doing this?

Thanks.
Reply
#2
I know the code isn't very clean, but this is what I use:

PHP Code:
    json_query xbmc.executeJSONRPC('{ "jsonrpc": "2.0", "id": 0, "method": "Settings.getSettings", "params": { "filter":{"section":"system", "category":"debug"} } }')
    
json_query unicode(json_query'utf-8'errors='ignore')
    
json_response simplejson.loads(json_query)
    
    if 
json_response.has_key('result') and json_response['result'].has_key('settings') and json_response['result']['settings'is not None:
        for 
item in json_response['result']['settings']:
            if 
item["id"] == "debug.showloginfo":
                if 
item["value"] == True:
                    ... 
Reply
#3
Thanks!!! That's what I needed!

The json calls are always ugly Smile
Reply

Logout Mark Read Team Forum Stats Members Help
Is there anyway to detect the loglevel (if debug has been set)?0