TotallyInformation / node-red-contrib-uibuilder

Easily create data-driven web UI's for Node-RED using any (or no) front-end framework.
https://totallyinformation.github.io/node-red-contrib-uibuilder/#/
Apache License 2.0
457 stars 87 forks source link

Stuff written to uibuilder.log even when debug set to false #8

Closed colinl closed 7 years ago

colinl commented 7 years ago

Even with debug set to false in settings.js two messages are written to uibuilder.log each time node-red is restarted: 2017-09-22T15:31:53.007Z - info: UI Builder - Version 0.3.7 started at /uibuilder 2017-09-22T15:31:53.012Z - info: UI Builder - Local file overrides at /home/user/.node-red/uibuilder/uibuilder

I suggest this is undesirable as the file will grow without bounds (though slowly I agree). The reason, I think, is that they are written using log.info rather than log.debug. By the way the lines logging the started at message to log and Red.log could be moved out of the if customFoldersReqd test at uibuilder.js line 291

TotallyInformation commented 7 years ago

Yes, that's correct and is mentioned in the readme as something that needs improving. Thanks for raising. Marking as an enhancement. Please let me know if you have any thoughts about the best approach for logging.

I think that "production" logging should go direct to the Node-RED log. Just the startup messages and any errors.

For dev/debug logging, I'm going to leave Winston in for now, when things mature a bit more, I may remove it.

colinl commented 7 years ago

I think for the moment just changing those particular ones to be log.debug would be worth while, so that the file is not written to if debug is not set. The information is already written to the node red log so is redundant in the uibuilder log file unless debug is set.

TotallyInformation commented 7 years ago

Fixed in v0.4.2 just pushed.

Log file is only written if you set debug: true in settings.js uibuilder section.