Page 1 of 1

Domotic.Log method for python plugin framework and domoticz log levels

Posted: Thursday 10 May 2018 13:08
by EscApe
Hi,

I'm running the domoticz service with -loglevel 1, which should show error and status messages. With this setting anything from within a python plugin except Domoticz.Error is ignored. Even when i set the plugin to debug mode "Domoticz.Debugging(1)".

Is there a way to generate a status message from a python plugin, so they will show with -loglevel 1? Or could different log levels be implemented for python plugins?

Use cases:
My Presence detection plugin logs when devices leave or arrive. I would like to see these messages in my log, but i do not want to enable the overall -loglevel 0 for domoticz, because that will flood my log with events from energy meters (P1), z-wave devices and other less important information.

If i (purposely) enable debug mode on a plugin i would like to see debug logging, regardless of the overall domoticz log setting.

Re: Domotic.Log method for python plugin framework and domoticz log levels

Posted: Sunday 13 May 2018 7:12
by Dnpwwo
@EscApe,

Couple of things, "Domoticz.Debugging(1)" is pretty verbose these days but the call now accepts a mask that will allow you to select what you see.

I'm reluctant to ignore things like the domoticz loglevel setting because one of the things I wanted to achieve with the plugins was to make them indistinguishable from either C++ brethern.

I added a 'Status' function to the Python API today (see https://www.domoticz.com/wiki/Developin ... llable_API) which may give you what you want.

Re: Domotic.Log method for python plugin framework and domoticz log levels

Posted: Sunday 13 May 2018 13:09
by EscApe
@Dnpwwo,

That's exactly what i was asking for (or at least tried to explain;-)). Just compiled and modified my plugin, and its working like a charm.

Thanks!

Re: Domotic.Log method for python plugin framework and domoticz log levels

Posted: Wednesday 21 November 2018 10:53
by pipiche
If I want to be able to use pylint and eventually debug offlie (out of Domoticz Framework), is there somewhere a Domoticz Class defined ?