Possibility to log warnings (dzVents)

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

Post Reply
ml17950
Posts: 2
Joined: Tuesday 21 March 2023 11:43
Target OS: Linux
Domoticz version: beta
Location: Germany
Contact:

Possibility to log warnings (dzVents)

Post by ml17950 »

Hi.

In my dzVents-scripts I use logging to monitor events.
But there so many events (like: EventSystem: Script event triggered), I donn't care (mostly).
So, I use LOG_ERROR do log "my" events.
But then, I can't differentiate between "my loggings" and errors.

So, I added also warnings to the log-system (see attachments).

Maybe something for the beta-channel?

(git patch-file avaiable - but can't upload here)
Attachments
Screenshot-2.png
Screenshot-2.png (35.29 KiB) Viewed 1082 times
Screenshot-1.png
Screenshot-1.png (19.63 KiB) Viewed 1082 times
Intel NUC with Proxmox with Debian with Domoticz
Kedi
Posts: 536
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: Possibility to log warnings (dzVents)

Post by Kedi »

I like that, great idea. :D
Logic will get you from A to B. Imagination will take you everywhere.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Possibility to log warnings (dzVents)

Post by waltervl »

It would be nice to treat most DzVents logging as Info logging instead of status logging.
Then we could just use the standard Domoticz Info/Status/Error log levels and filters and no need to add a Warning log level.
All those "EventSystem: Script event triggered" log lines should be info logging instead of Status.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
ml17950
Posts: 2
Joined: Tuesday 21 March 2023 11:43
Target OS: Linux
Domoticz version: beta
Location: Germany
Contact:

Re: Possibility to log warnings (dzVents)

Post by ml17950 »

@Kedi: thanks

@waltervl Yes, but there so many more locations in the code to change - for example - status to internal, that a new loglevel was easier to implement.
Intel NUC with Proxmox with Debian with Domoticz
stephanvdplas
Posts: 73
Joined: Wednesday 13 February 2019 18:09
Target OS: Windows
Domoticz version: 2023.1
Location: Netherlands
Contact:

Re: Possibility to log warnings (dzVents)

Post by stephanvdplas »

In addition, I would opt for a LOG_NONE level, to suppress errors from some specific scripts (in my environment, a call to the Denon http API always gives an error (http://192.168.x.y/goform/formiPhoneAppDirect.xml?MV495) when changing the volume.)
- Running LMS, Domoticz and Dashticz on a windows 11 laptop.
- LMS (11 players) / Hue (26 lights, 2 switches) / Z-wave (14 devices) / Toon (unrooted) / Chromecast
HvdW
Posts: 504
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Re: Possibility to log warnings (dzVents)

Post by HvdW »

Is there a way in dzvents to have a dump of the logging messages?
In that way warnings could be filtered with a grep-like command en the text put in a TEXT sensor
Plus a notification can be sent.
@elzorrovega did some work on extracting the log data.

On the other hand; who cares that a script gives errors. Let it be.
Bugs bug me.
willemd
Posts: 621
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Possibility to log warnings (dzVents)

Post by willemd »

You can specify in which file the logging should be stored. I store the logging on a usb mounted drive.

From there you can apply any command on it, like grep or tail.
You can then put the result on a text sensor, or send a notification for example.
HvdW
Posts: 504
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Re: Possibility to log warnings (dzVents)

Post by HvdW »

willemd wrote: Friday 09 February 2024 9:44 You can specify in which file the logging should be stored. I store the logging on a usb mounted drive.

From there you can apply any command on it, like grep or tail.
You can then put the result on a text sensor, or send a notification for example.
Nice solution
Bugs bug me.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest