HomeSeer / node-red-contrib-homeseer

HomeSeer Nodes for Node-RED
GNU Affero General Public License v3.0
5 stars 4 forks source link

Debug messages being written to nod-red console #9

Closed kmitch95120 closed 3 years ago

kmitch95120 commented 3 years ago

I run node-red as a systemd service and below is an sample of some of the debug messages being written to the console. With lots of nodes, this can get messy in a hurry. The console.log statements should either be commented out or wrapped in a conditional with a "debug" flag so the user can easily turn them on or off.


Oct 5 09:55:07 hs3b Node-RED[30617]: device update: Oct 5 09:55:07 hs3b Node-RED[30617]: { Oct 5 09:55:07 hs3b Node-RED[30617]: ref: 85, Oct 5 09:55:07 hs3b Node-RED[30617]: name: 'Temperature', Oct 5 09:55:07 hs3b Node-RED[30617]: location: 'Attic', Oct 5 09:55:07 hs3b Node-RED[30617]: location2: '1-Wire', Oct 5 09:55:07 hs3b Node-RED[30617]: value: 61.7, Oct 5 09:55:07 hs3b Node-RED[30617]: status: '61.70', Oct 5 09:55:07 hs3b Node-RED[30617]: last_change: '/Date(1601916906223-0700)/' Oct 5 09:55:07 hs3b Node-RED[30617]: } Oct 5 09:55:59 hs3b Node-RED[30617]: 5 Oct 09:55:59 - [info] Stopping modified flows Oct 5 09:55:59 hs3b Node-RED[30617]: device close Oct 5 09:55:59 hs3b Node-RED[30617]: 5 Oct 09:55:59 - [info] Stopped modified flows Oct 5 09:55:59 hs3b Node-RED[30617]: 5 Oct 09:55:59 - [info] Starting modified flows Oct 5 09:55:59 hs3b Node-RED[30617]: 5 Oct 09:55:59 - [info] Started modified flows

spudwebb commented 3 years ago

I think we should replace any occurrence of console.log() with this.debug() so that nothing is logged in console unless level is set to debug https://nodered.org/docs/creating-nodes/node-js#logging-events

kmitch95120 commented 3 years ago

Agree. I see a few places where errors are being reported so we should change those to this.error(). I like the idea that warn and error get written to the flow editor debug tab.

spudwebb commented 3 years ago

this is done in 1.0.5