Skip to content

Commit

Permalink
feat: write to multiple streams (fixes #26)
Browse files Browse the repository at this point in the history
  • Loading branch information
jordrake committed May 30, 2018
1 parent 8be0371 commit 3872e8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 4 additions & 1 deletion signale.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ class Signale {
}

_log(message, stream = this._stream) {
stream.write(message + '\n');
const streams = Array.isArray(stream) ? stream : [stream];
streams.forEach(stream => {
stream.write(message + '\n');
});
}

_formatDate() {
Expand Down
3 changes: 1 addition & 2 deletions types.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ module.exports = {
error: {
badge: figures.cross,
color: 'red',
label: 'error',
stream: process.stderr
label: 'error'
},
fatal: {
badge: figures.cross,
Expand Down

0 comments on commit 3872e8c

Please sign in to comment.