We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 56afe2d commit c9b1e66Copy full SHA for c9b1e66
lib/log.js
@@ -104,10 +104,13 @@ Log.prototype = {
104
*/
105
106
read: function(){
107
- var self = this;
+ var buf = ''
108
+ , self = this;
109
this.stream.setEncoding('ascii');
110
this.stream.on('data', function(chunk){
- chunk.split('\n').map(function(line){
111
+ buf += chunk;
112
+ if ('\n' != buf[buf.length - 1]) return;
113
+ buf.split('\n').map(function(line){
114
if (!line.length) return;
115
var captures = line.match(/^\[([^\]]+)\] (\w+) (.*)/);
116
var obj = {
@@ -118,6 +121,7 @@ Log.prototype = {
118
121
};
119
122
self.emit('line', obj);
120
123
});
124
+ buf = '';
125
126
},
127
0 commit comments