You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
comment out console.debug calls
Potential solution B:
add somewhere in the configuration the activation of the "debug mode" (or use an ENV variable, but avoid reading ENV every time for performance reasons - reading at startup and saving the value in a Boolean variable is much more efficient).
implement a tiny custom console.debug() function to be used in place of custom.debug().
The text was updated successfully, but these errors were encountered:
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:
The text was updated successfully, but these errors were encountered: