mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
PushInteractor: correctly formats logs before sending them
This commit is contained in:
parent
1915fdd43f
commit
0c546eda7c
@ -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;
|
||||
|
||||
@ -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 = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user