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.
Domotic.Log method for python plugin framework and domoticz log levels
Moderator: leecollings
- Dnpwwo
- Posts: 820
- Joined: Sunday 23 March 2014 9:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Melbourne, Australia
- Contact:
Re: Domotic.Log method for python plugin framework and domoticz log levels
@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.
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.
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
-
EscApe
- Posts: 540
- Joined: Thursday 02 April 2015 8:46
- Target OS: Linux
- Domoticz version: 2026.3
- Location: The Netherlands
- Contact:
Re: Domotic.Log method for python plugin framework and domoticz log levels
@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!
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
If I want to be able to use pylint and eventually debug offlie (out of Domoticz Framework), is there somewhere a Domoticz Class defined ?