removing logging
This commit is contained in:
parent
199a5d1cd5
commit
02b91e2d61
@ -5,31 +5,12 @@ var logger = require('log4js').getLogger();
|
||||
|
||||
var EventEmitter = require('events');
|
||||
|
||||
var nano = require('nano')('http://martind2000:1V3D4m526i@localhost:5984');
|
||||
//var nano = require('nano')('http://martind2000:1V3D4m526i@localhost:5984');
|
||||
//var nano = require('nano')('http://localhost:5984');
|
||||
var busEmitter = new EventEmitter();
|
||||
|
||||
var db_name = 'mqtt';
|
||||
var dbCouch = nano.use(db_name);
|
||||
|
||||
|
||||
|
||||
function insertEntry(obj) {
|
||||
logger.debug('Inserting into couch...');
|
||||
logger.info(util.inspect(obj));
|
||||
dbCouch.insert(obj, function(err, body, header) {
|
||||
if (err) {
|
||||
logger.error('Error inserting into couch');
|
||||
return;
|
||||
}
|
||||
});
|
||||
logger.debug('Insert done..');
|
||||
}
|
||||
|
||||
var doInsertEntry = (obj) => {
|
||||
// Logger.info('sendSocket: ' + JSON.stringify(obj));
|
||||
insertEntry(obj);
|
||||
};
|
||||
//var dbCouch = nano.use(db_name);
|
||||
|
||||
|
||||
|
||||
@ -95,9 +76,7 @@ var mqttClient = function() {
|
||||
|
||||
this.livingRoom.temp = json.temp;
|
||||
|
||||
busEmitter.emit('saveData', json);
|
||||
|
||||
}.bind(this));
|
||||
}.bind(this));
|
||||
|
||||
this.isConnected = function() {
|
||||
return this.connected;
|
||||
@ -105,8 +84,6 @@ var mqttClient = function() {
|
||||
|
||||
|
||||
|
||||
busEmitter.on('saveData', doInsertEntry);
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user