python plugin: logging special characters
Posted: Friday 04 August 2017 18:54
I have a device which sends XML of HTTP. For example:
This message is stored in a variable eg 'txt'
When executing:
It appear in the logging as:
When adding additional escape chars ( Domoticz.Log(re.escape(txt)) ):
How a I log the original message?
Code: Select all
<?xml version="1.0" encoding="utf-8"?><envelope><HDCPError>200</HDCPError><HDCPErrorDetail>OK</HDCPErrorDetail><session>479877994</session></envelope>
When executing:
Code: Select all
Domoticz.Log(txt)
Code: Select all
2017-08-04 18:51:47.880 (TV) 200OK479877994
Code: Select all
2017-08-04 18:36:27.041 (TV) \<\?xml\ version\=\"1\.0\"\ encoding\=\"utf\-8\"\?\>\\200\<\/HDCPError\>\OK\<\/HDCPErrorDetail\>\479877994\<\/session\>\<\/envelope\>