PushInteractor: correctly formats logs before sending them

This commit is contained in:
jshkurti 2015-06-24 18:07:13 +02:00
parent 1915fdd43f
commit 0c546eda7c
2 changed files with 8 additions and 2 deletions

View File

@ -216,6 +216,7 @@ var Daemon = {
start : function() {
var self = this;
self.logs = false;
self.opts = self.validateData();
self.opts.ipm2 = null;
self.current_km_data = null;

View File

@ -123,7 +123,8 @@ var PushInteractor = module.exports = {
processEvents : function() {
this.ipm2.bus.on('*', function(event, packet) {
if (event == 'axm:action' || event.match(/^log:/)) return false;
if (event == 'axm:action') return false;
if (event.match(/^log:/) && false) return false;
/**
* This is a heapdump action
@ -153,6 +154,10 @@ var PushInteractor = module.exports = {
server: PushInteractor.conf.MACHINE_NAME
};
if (event.match(/^log:/)) {
packet.log_type = event.split(':')[1];
event = 'logs';
}
return PushInteractor.bufferData(event, packet);
});
},
@ -207,7 +212,7 @@ var PushInteractor = module.exports = {
this.preparePacket(function() {
var data = {};
debug("Before: %s", self._packet);
debug("Before: %s", util.inspect(self._packet, false, null, false));
if (process.env.NODE_ENV && process.env.NODE_ENV == 'test') {
data = {