Improve logging.

This commit is contained in:
Koen Kanters 2019-01-07 18:18:14 +01:00
parent 932a66a5c4
commit a2ea9c548f
2 changed files with 4 additions and 3 deletions

View File

@ -32,13 +32,14 @@ class DeviceConfigure {
if (!this.configured.includes(ieeeAddr) && mappedDevice.configure) {
const friendlyName = settings.getDevice(ieeeAddr) ? settings.getDevice(ieeeAddr).friendly_name : 'unknown';
logger.debug(`Configuring ${friendlyName} (${ieeeAddr}) ...`);
// Call configure function of this device.
mappedDevice.configure(ieeeAddr, this.zigbee.shepherd, this.zigbee.getCoordinator(), (ok, msg) => {
if (ok) {
logger.info(`Succesfully configured ${friendlyName} ${ieeeAddr}`);
logger.info(`Succesfully configured ${friendlyName} (${ieeeAddr})`);
} else {
logger.error(`Failed to configure ${friendlyName} ${ieeeAddr} ('${msg}')`);
logger.error(`Failed to configure ${friendlyName} (${ieeeAddr}) ('${msg}')`);
}
});

View File

@ -92,7 +92,7 @@ class Zigbee {
// Mount cieApp
this.shepherd.mount(cieApp, (err, epId) => {
if (!err) {
logger.debug(`Mounted the cieApp (epId {epId})`);
logger.debug(`Mounted the cieApp (epId ${epId})`);
} else {
logger.error(`Failed to mount the cieApp`);
}