From 152363bf2b430551604631da970b004f9a1b4478 Mon Sep 17 00:00:00 2001 From: Naoyuki Kanezawa Date: Sat, 3 Sep 2016 01:23:24 +0900 Subject: [PATCH] Revert "Use now-io API v2" --- lib/build-logger.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/build-logger.js b/lib/build-logger.js index 536e12a..f0d6700 100644 --- a/lib/build-logger.js +++ b/lib/build-logger.js @@ -14,7 +14,7 @@ export default class Logger extends EventEmitter { // readyState this.building = false; - this.socket = io(`https://io.now.sh?host=${host}&v=2`); + this.socket = io(`https://io.now.sh?host=${host}`); this.socket.once('error', this.onSocketError.bind(this)); this.socket.on('state', this.onState.bind(this)); this.socket.on('logs', this.onLog.bind(this)); @@ -56,20 +56,18 @@ export default class Logger extends EventEmitter { if (this.quiet) return; - const data = log.object ? JSON.stringify(log.object) : log.text; - if ('command' === log.type) { - console.log(`${chalk.gray('>')} ▲ ${data}`); + console.log(`${chalk.gray('>')} ▲ ${log.data}`); this.lines.reset(); } else if ('stderr' === log.type) { - data.split('\n').forEach((v) => { + log.data.split('\n').forEach((v) => { if (v.length) { console.error(chalk.red(`> ${v}`)); } }); this.lines.reset(); } else if ('stdout' === log.type) { - data.split('\n').forEach((v) => { + log.data.split('\n').forEach((v) => { if (v.length) { this.lines.write(`${chalk.gray('>')} ${v}`); }