|
|
@ -8,6 +8,7 @@ export default class Logger extends EventEmitter { |
|
|
|
constructor (host, { debug = false, quiet = false } = {}) { |
|
|
|
super(); |
|
|
|
this.host = host; |
|
|
|
this.debug = debug; |
|
|
|
this.quiet = quiet; |
|
|
|
|
|
|
|
// readyState
|
|
|
@ -84,10 +85,10 @@ export default class Logger extends EventEmitter { |
|
|
|
this.emit('close'); |
|
|
|
} |
|
|
|
|
|
|
|
onSocketError () { |
|
|
|
this.removeAllListeners(); |
|
|
|
console.error('> Connection error'); |
|
|
|
this.emit('error'); |
|
|
|
onSocketError (err) { |
|
|
|
if (this.debug) { |
|
|
|
console.log('> [debug] Socket error', err.stack); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|