mirror of
https://gitlab.silvrtree.co.uk/martind2000/mdot_mqtt.git
synced 2025-02-10 23:19:15 +00:00
A little bit of additional logging
This commit is contained in:
parent
802e205cd4
commit
bac675edcd
@ -56,22 +56,22 @@ var doInsertEntry = (obj) => {
|
||||
dbSave.addNewEvent(obj)
|
||||
.then(function(d) {
|
||||
'use strict';
|
||||
console.log('Finished - Raw',d);
|
||||
logger.info('Finished - Raw',d);
|
||||
})
|
||||
.catch(function(e) {
|
||||
'use strict';
|
||||
console.error(e);
|
||||
logger.error(e);
|
||||
});
|
||||
|
||||
|
||||
dbSave.addProcessedEvent(obj)
|
||||
.then(function(d) {
|
||||
'use strict';
|
||||
console.log('Finished - Processed',d);
|
||||
logger.info('Finished - Processed',d);
|
||||
})
|
||||
.catch(function(e) {
|
||||
'use strict';
|
||||
console.error(e);
|
||||
logger.error(e);
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -17,6 +17,7 @@ module.exports = function(db) {
|
||||
return resolve('ok');
|
||||
})
|
||||
.catch((err)=> {
|
||||
console.error(err);
|
||||
return reject(err);
|
||||
});
|
||||
});
|
||||
@ -33,6 +34,7 @@ module.exports = function(db) {
|
||||
return resolve('ok');
|
||||
})
|
||||
.catch((err)=> {
|
||||
console.error(err);
|
||||
return reject(err);
|
||||
});
|
||||
});
|
||||
@ -54,6 +56,7 @@ module.exports = function(db) {
|
||||
return resolve({reply: 'raw event inserted'});
|
||||
})
|
||||
.catch((err)=> {
|
||||
console.error(err);
|
||||
return reject(err);
|
||||
});
|
||||
});
|
||||
@ -72,6 +75,7 @@ module.exports = function(db) {
|
||||
return resolve({reply: 'Processed event inserted'});
|
||||
})
|
||||
.catch((err)=> {
|
||||
console.error(err);
|
||||
return reject(err);
|
||||
});
|
||||
|
||||
@ -92,6 +96,7 @@ module.exports = function(db) {
|
||||
_obj.humid = (parseInt(_data[12] + _data[13] + _data[14] + _data[15] + _data[16], 10) / 10);
|
||||
_obj.noise = parseInt('0x' + ('0' + bytes[17]).substr(-2) + ('0' + bytes[18]).substr(-2));
|
||||
_obj.binData = bytes;
|
||||
console.log(_obj);
|
||||
return _obj;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user