Homegear / Homegear

Interface your smart home devices with your home automation software or your own control scripts.
https://homegear.eu
Other
122 stars 38 forks source link

[Enhancement][low-prio]optimize script output #273

Closed spali closed 7 years ago

spali commented 7 years ago

If script output ends with a newline, the script log file contains an empty line. I assume to every script output a newline is pre- or appended.

homegear-scriptengine.log:

...
03/01/17 14:17:35.343 Script output: DEBUG -> Device_HM_V_Saia->updateValues -> -1250 > -1250                                                                                                                      

03/01/17 14:17:36.341 Script output: DEBUG -> Device_HM_V_Saia->updateValues -> -1250 > -1250 
...

I would suggest to just trim the last newline of a script if there is already one or just replace a double newline at the end of a script output.

Other possibility is to separate script engine internal related stuff from the user script output and write the raw script output to additional log files (i.e. homegear-scriptoutput.log and homegear-scriptoutput.err) and let the user script handle the complete formatting if required.

spali commented 7 years ago

small part of #194

hfedcba commented 7 years ago

Done ;-).

spali commented 7 years ago

thanks