2015-02-18, 17:21
I'm trying to determine within an addon whether the xbmc debug logging is enabled
From guisettings.xml the setting appears to be showloginfo:
So I would assume that this code should work and return a 1 when enabled:
Though so far I haven't had any luck, always returns 0
Is this the correct setting value I should be checking? Syntax is correct?
Here's some json that works:
From guisettings.xml the setting appears to be showloginfo:
Code:
<debug>
<extralogging default="true">false</extralogging>
<screenshotpath default="true"></screenshotpath>
<setextraloglevel default="true"></setextraloglevel>
<showloginfo>true</showloginfo>
</debug>
So I would assume that this code should work and return a 1 when enabled:
Code:
xbmc.getCondVisibility('System.Setting(showloginfo)')
Though so far I haven't had any luck, always returns 0
Is this the correct setting value I should be checking? Syntax is correct?
Here's some json that works:
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 = json.loads(json_query)
if 'result' in json_response and 'settings' in json_response['result'] and json_response['result']['settings'] is not None:
for item in json_response['result']['settings']:
if item["id"] == "debug.showloginfo":
if item["value"] == True:
print 'debug is on'
else:
print 'debug is off'
break