Comparing version 3.4.5 to 3.5.0
@@ -17,2 +17,5 @@ var child_process = require('child_process'); | ||
var startOfStackTraceRE = /^Exception in thread /; | ||
var continueOfStackTraceRE = /^\s*(at |Refer to the log for complete error details)/; | ||
var Node = module.exports = function Node (options) { | ||
@@ -85,8 +88,31 @@ this.version = options.version; | ||
var self = this; | ||
var stack = null; | ||
return through2(function (line, enc, cb) { | ||
cb(); | ||
line = line.toString('utf8'); | ||
var message = line.toString('utf8').trim(); | ||
if (stack) { | ||
if (continueOfStackTraceRE.test(line)) { | ||
stack.push(' ' + line.trim()); | ||
return; | ||
} else { | ||
self.parseLog(stream, stack.join('\n')); | ||
stack = null; | ||
} | ||
} | ||
if (startOfStackTraceRE.test(line)) { | ||
stack = [line]; | ||
return; | ||
} | ||
var message = line.trim(); | ||
if (!message) return; | ||
self.parseLog(stream, message); | ||
}, function () { | ||
if (stack) { | ||
self.parseLog(stream, stack.join('\n')); | ||
stack = null; | ||
} | ||
}); | ||
@@ -121,2 +147,12 @@ }; | ||
if (matches = line.match(startOfStackTraceRE)) { | ||
return { | ||
timestamp: moment().toDate(), | ||
level: 'warning', | ||
type: 'stack', | ||
node: '-', | ||
message: line | ||
}; | ||
} | ||
if (matches = line.match(/^\[([^\]]+)\]\[([^\]]+)\]\[([^\]]+)\]\s*\[([^\]]+)\](.+)/)) { | ||
@@ -123,0 +159,0 @@ return { |
{ | ||
"name": "libesvm", | ||
"version": "3.4.5", | ||
"version": "3.5.0", | ||
"description": "libesvm is a library for managning an Elasticsearch process for development and testing.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
63004
1763