Make "Status: EventSystem: Script event triggered:" log more intelligible Topic is solved

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
plugge

Make "Status: EventSystem: Script event triggered:" log more intelligible

Post by plugge »

I would like to suggest to make log lines about Status Script event triggered more intelligible by including the script name.
Currently, we get pretty useless log lines like this:

Code: Select all

2021-02-16 23:48:00.375 Status: EventSystem: Script event triggered: D:\Program Files (x86)\Domoticz\dzVents\runtime\dzVents.lua
2021-02-16 23:48:00.500 Status: EventSystem: Script event triggered: D:\Program Files (x86)\Domoticz\dzVents\runtime\dzVents.lua
2021-02-16 23:49:00.124 Status: EventSystem: Script event triggered: D:\Program Files (x86)\Domoticz\dzVents\runtime\dzVents.lua
etc.
etc.
I know I can turn on more logging, or make the script tell which script is executed, but that results in at least a doubling of the log lines.

When saving a script, Domoticz lists all the scripts with their path and script name:

Code: Select all

2021-02-16 23:58:43.350 Status: dzVents: Write file: D:\Program Files (x86)\Domoticz\scripts\dzVents\generated_scripts\quakesEU.lua
2021-02-16 23:58:43.350 Status: dzVents: Write file: D:\Program Files (x86)\Domoticz\scripts\dzVents\generated_scripts\dailyEnergyCosts.lua
etc.
etc.
So, the following example would be more helpfull as a log line:

Code: Select all

2021-02-16 23:48:00.375 Status: EventSystem: Script event triggered: D:\Program Files (x86)\Domoticz\dzVents\runtime\quakesEU.lua
Or is this too hard to code due to some limitation(s)?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Make "Status: EventSystem: Script event triggered:" log more intelligible

Post by waaren »

plugge wrote: Wednesday 17 February 2021 0:19 I would like to suggest to make log lines about Status Script event triggered more intelligible by including the script name.
Did you try to set below in settings - other ?
log settings.jpg
log settings.jpg (26.4 KiB) Viewed 682 times
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
plugge

Re: Make "Status: EventSystem: Script event triggered:" log more intelligible

Post by plugge »

waaren wrote: Wednesday 17 February 2021 0:26
plugge wrote: Wednesday 17 February 2021 0:19 I would like to suggest to make log lines about Status Script event triggered more intelligible by including the script name.
Did you try to set below in settings - other ?
Yes, I did. And I mentioned it in the post.
It triples the amount of log lines.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Make "Status: EventSystem: Script event triggered:" log more intelligible

Post by waaren »

plugge wrote: Wednesday 17 February 2021 0:29 It triples the amount of log lines.
Maybe I miss something but if I use this setting I don't see the behavior you describe. Can you please show what kind of extra loglines you see?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
plugge

Re: Make "Status: EventSystem: Script event triggered:" log more intelligible

Post by plugge »

Here's an example:

Code: Select all

2021-02-17 00:23:00.197 Status: dzVents: Info: ------ Start internal script: tesyStatus:, trigger: "every 1 minutes"
2021-02-17 00:23:00.212 Status: dzVents: Info: ------ Finished tesyStatus
2021-02-17 00:23:00.212 Status: EventSystem: Script event triggered: D:\Program Files (x86)\Domoticz\dzVents\runtime\dzVents.lua
2021-02-17 00:23:00.291 Status: dzVents: Info: Handling httpResponse-events for: "status"
2021-02-17 00:23:00.291 Status: dzVents: Info: ------ Start internal script: tesyStatus: HTTPResponse: "status"
2021-02-17 00:23:00.322 Status: dzVents: Info: ------ Finished tesyStatus
2021-02-17 00:23:00.322 Status: EventSystem: Script event triggered: D:\Program Files (x86)\Domoticz\dzVents\runtime\dzVents.lua
One line would do the job if the script name is included.

Addendum:
I do like to log that scripts are executed, so I keep "Log 'event script triggers'" On. But it would be more informative if it included the script name.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Make "Status: EventSystem: Script event triggered:" log more intelligible

Post by waaren »

plugge wrote: Wednesday 17 February 2021 0:36 One line would do the job if the script name is included.

Addendum:
I do like to log that scripts are executed, so I keep "Log 'event script triggers'" On. But it would be more informative if it included the script name.
If you use the settings I advised you should not see below type of line

Code: Select all

2021-02-17 00:23:00.212 Status: EventSystem: Script event triggered: D:\Program Files (x86)\Domoticz\dzVents\runtime\dzVents.lua
The reason that you see two times the line

Code: Select all

 ------ Start internal script: tesyStatus: HTTPResponse: "status"
is that it is triggered twice; so not much you can do about that.

If you want to keep the logline for "EventSystem: Script event triggered" then you will have to live with this for you useless information. The domoticz eventSystem only sees dzVents.lua
The dzVents user scripts, when triggered, are only visible to dzVents and not for the EventSystem.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
plugge

Re: Make "Status: EventSystem: Script event triggered:" log more intelligible

Post by plugge »

waaren wrote: Wednesday 17 February 2021 0:58 The domoticz eventSystem only sees dzVents.lua
The dzVents user scripts, when triggered, are only visible to dzVents and not for the EventSystem.
So that's the limitation.
Thanks for clearing that up waaren.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest