Open xtvdata opened 2 years ago
@xtvdata I will get a look at it. I was already planning to do this.
Thanks
Thanks for the quick reply.
For a subproject such as this one I'd suggest to avoid using a dedicated library/npm-module designed for complex logging. A simple approach like the above can be effective and with a very low impact on resources used.
A note to all concerned with logging verbosity, or wants to avoid logging configuration (Solution A).
To disable all logging, go to the directory in node_modules directory where node-red-contrib-smartthings is installed (e.g.: /home/node-red/.node-red/node_modules/node-red-contrib-smartthings/smartthings
and run the commands:
sed -i 's/console.debug/\/\/console.debug/g' *.js
and
sed -i 's/console.log/\/\/console.log/g' *.js
Then restart nodered.
This will quickly comment out all the console messages.
After noticing the verbosity of the log produced, I've had quick look at the code and I've seen that console.debug() is used extensively.
However console.debug() does not filter output.
Current behavior: everything is printed in the log on any message (including sensitive info).
Desired behavior: debug messages should only appear if a debug mode has been explicitly activated.
Potential solution A:
Potential solution B: