Skip to content

Commit

Permalink
fix: use trace and debug levels for unimportant log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmattmatt committed Dec 2, 2018
1 parent 404a921 commit 0805196
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/PioneerAvrConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ export default function PioneerAvrConfig(RED) {

const onError = error => {
console.error(`pioneer-avr-config: Error at ${host}`, error);
node.warn(`pioneer-avr-config: Error at ${host}`);

clearTimeout(reconnectionTimeout);
reconnectionTimeout = setTimeout(startConnection, RECONNETION_INTERVAL_SECS);

Expand Down
8 changes: 4 additions & 4 deletions src/PioneerAvrOut.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default function PioneerAvrOut(RED) {
.toString()
.replace('\n', '')
.replace('\r', '');
node.log(`Data from avr: ${data}`);
node.debug(`Data from avr: ${data}`);

if (data.startsWith('PWR')) {
avrState.on = parse(data[3]) === 0;
Expand All @@ -88,12 +88,12 @@ export default function PioneerAvrOut(RED) {
}

if (data !== 'R') {
node.log(`AVR state ${JSON.stringify(avrState)}`);
node.trace(`AVR state ${JSON.stringify(avrState)}`);
}
};

const sendData = data => {
node.log(`Sending to AVR ${data}`);
node.debug(`Sending to AVR ${data}`);
node.serverConfig.client.write(`${data}\n\r`);
};

Expand Down Expand Up @@ -150,7 +150,7 @@ export default function PioneerAvrOut(RED) {
};

const onInput = msg => {
node.log(`Node input: ${JSON.stringify(msg.payload)}`);
node.trace(`Node input: ${JSON.stringify(msg.payload)}`);
queue.push(msg.payload);
sendNext();
};
Expand Down

0 comments on commit 0805196

Please sign in to comment.