Skip to content

Commit

Permalink
- Check log level
Browse files Browse the repository at this point in the history
 - Change log level for "handleDeviceJoined" message
  • Loading branch information
agav99 committed Jan 2, 2025
1 parent 8511840 commit b5cb521
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/zigbeecontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ class ZigbeeController extends EventEmitter {
}

async handleDeviceJoined(message) {
this.debug('handleDeviceJoined', message);
this.warn('handleDeviceJoined', message);
//const entity = await this.resolveEntity(message.device || message.ieeeAddr);
//this.emit('new', entity);
}
Expand Down
7 changes: 5 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1106,9 +1106,12 @@ class Zigbee extends utils.Adapter {
if (typeof data === 'string') {
logger(`${msg}. ${data}`);
} else {
if (this.log.level==level)
if ((this.log.level==level) ||
((this.log.level='warn')&&(level='error')) ||
((this.log.level='info')&&(level='error' || level=='warn'))
)
logger(`${msg}. ${safeJsonStringify(data)}`)
else logger(`${msg}. {DATA unavailable. Check log level}`);
else logger(`${msg}. DATA unavailable. Check log level. MsgLevel:${level} AdaptorLevel:${this.log.level}`);
}
} else {
logger(msg);
Expand Down

0 comments on commit b5cb521

Please sign in to comment.