Log functions in Domoticz

Python and python framework

Moderator: leecollings

Post Reply
User avatar
psubiaco
Posts: 222
Joined: Monday 20 August 2018 9:38
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Italy
Contact:

Log functions in Domoticz

Post by psubiaco »

Hi,
on python plugin I have the possibility to enable/disable Info, Error, Status logging.
Domoticz.Log() logs anything to the log
Domoticz.Debug() logs only if Domoticz.Debugging==1 or Domoticz.Debugging&2 , right?
Domoticz.Error() logs only if Error logging is enabled in the plugin configuration
Domoticz.Status() logs only if Status logging is enabled in the plugin configuration
WHAT ABOUT Info ?
error_status_info.png
error_status_info.png (9.67 KiB) Viewed 1176 times
Paolo
--
I use DomBus modules to charge EV car, get a full alarm system, control heat pump, fire alarm detection, lights and much more. Video
Facebook page - Youtube channel
Kedi
Posts: 575
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: Log functions in Domoticz

Post by Kedi »

Did you try it? And what are the differences?
Logic will get you from A to B. Imagination will take you everywhere.
User avatar
waltervl
Posts: 5853
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Log functions in Domoticz

Post by waltervl »

I do not understand you question...
The log level settings in your screenshot decide if the info/status/error messages are being sent to the Domoticz log file.

A Python plugin can have additional debug levels (if implemented by the plugin author) and if set the debug messages will be shown as INFO messages in domoticz log if I am not wrong.

Edit:
I suppose Domoticz.Log() writes INFO messages.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
psubiaco
Posts: 222
Joined: Monday 20 August 2018 9:38
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Italy
Contact:

Re: Log functions in Domoticz

Post by psubiaco »

Hi Walter,
Domoticz.Log() always write to the log file, without care of Info ON/OFF status.
Domoticz.Error() and Domoticz.Status() work perfectly, but I don't know how to manage the Info ON/OFF flag.
Paolo
--
I use DomBus modules to charge EV car, get a full alarm system, control heat pump, fire alarm detection, lights and much more. Video
Facebook page - Youtube channel
User avatar
waltervl
Posts: 5853
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Log functions in Domoticz

Post by waltervl »

Then it seems it is not implemented correctly in the Python Framework. Do you use old or new framework (DomoticzEx)?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
psubiaco
Posts: 222
Joined: Monday 20 August 2018 9:38
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Italy
Contact:

Re: Log functions in Domoticz

Post by psubiaco »

waltervl wrote: Monday 29 January 2024 13:14 Then it seems it is not implemented correctly in the Python Framework. Do you use old or new framework (DomoticzEx)?
I'm using the old Domoticz framework.
Paolo
--
I use DomBus modules to charge EV car, get a full alarm system, control heat pump, fire alarm detection, lights and much more. Video
Facebook page - Youtube channel
User avatar
waltervl
Posts: 5853
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Log functions in Domoticz

Post by waltervl »

It is better to use the new framework, not guaranteed it will work but then it could be repaired,
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest