From 8903680a415ee687aabced63a03e41de8f81d068 Mon Sep 17 00:00:00 2001 From: Jordan Drake Date: Wed, 30 May 2018 09:26:46 +0100 Subject: [PATCH] feat: write to multiple streams (fixes #26) --- signale.js | 8 +++++++- types.js | 3 +-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/signale.js b/signale.js index 28ff7a61..25c0cba3 100644 --- a/signale.js +++ b/signale.js @@ -82,7 +82,13 @@ class Signale { } _log(message, stream = this._stream) { - stream.write(message + '\n'); + this._formatStream(stream).forEach(stream => { + stream.write(message + '\n'); + }); + } + + _formatStream() { + return Array.isArray(stream) ? stream : [stream]; } _formatDate() { diff --git a/types.js b/types.js index 4329b456..beeddeb1 100644 --- a/types.js +++ b/types.js @@ -5,8 +5,7 @@ module.exports = { error: { badge: figures.cross, color: 'red', - label: 'error', - stream: process.stderr + label: 'error' }, fatal: { badge: figures.cross,