Merge pull request #373 from kitematic/fix-logs

Fixing bug where logs would include headers
This commit is contained in:
Jeffrey Morgan 2015-04-13 13:18:58 -04:00
Родитель 2e330fd97b d4f18763a1
Коммит 520f607190
1 изменённых файлов: 6 добавлений и 4 удалений

Просмотреть файл

@ -33,8 +33,9 @@ module.exports = assign(Object.create(EventEmitter.prototype), {
throw err;
}
var logs = [];
logStream.setEncoding('utf-8');
logStream.on('data', (chunk) => {
var outstream = new stream.PassThrough();
docker.client().modem.demuxStream(logStream, outstream, outstream);
outstream.on('data', (chunk) => {
logs.push(_convert.toHtml(this._escape(chunk)));
});
logStream.on('end', () => {
@ -57,8 +58,9 @@ module.exports = assign(Object.create(EventEmitter.prototype), {
if (err) {
throw err;
}
logStream.setEncoding('utf-8');
logStream.on('data', (chunk) => {
var outstream = new stream.PassThrough();
docker.client().modem.demuxStream(logStream, outstream, outstream);
outstream.on('data', (chunk) => {
_logs[name].push(_convert.toHtml(this._escape(chunk)));
if (_logs[name].length > MAX_LOG_SIZE) {
_logs[name] = _logs[name].slice(_logs[name].length - MAX_LOG_SIZE, MAX_LOG_SIZE);