From d3651e4500b5a05e440e9e08825065c8048ee885 Mon Sep 17 00:00:00 2001 From: Nick Bottomley Date: Fri, 18 May 2018 05:26:07 -0700 Subject: [PATCH] Added ability to configure writable stream --- signale.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/signale.js b/signale.js index 5621a2e2..8f36b421 100644 --- a/signale.js +++ b/signale.js @@ -22,6 +22,7 @@ class Signale { this._scopeName = options.scope || ''; this._timers = options.timers || new Map(); this._types = Object.assign(types, this._customTypes); + this._stream = options.stream || process.stdout; Object.keys(this._types).forEach(type => { this[type] = this._logger.bind(this, type); @@ -80,7 +81,7 @@ class Signale { } _log(message) { - process.stdout.write(message + '\n'); + this._stream.write(message + '\n'); } _formatDate() {