Skip to content

Commit

Permalink
Added support for multiple streams & optional streams per logger. Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Drake authored and klaudiosinani committed May 30, 2018
1 parent 11ef63b commit 608f882
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions signale.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,17 @@ class Signale {
}

_logger(type, ...messageObj) {
this._log(this._buildSignale(this._types[type], ...messageObj));
this._log(this._buildSignale(this._types[type], ...messageObj), this._types[type].stream);
}

_log(message) {
this._stream.write(message + '\n');
_log(message, streams = this._stream) {
this._formatStream(streams).forEach(stream => {
stream.write(message + '\n');
});
}

_formatStream(stream) {
return Array.isArray(stream) ? stream : [stream];
}

_formatDate() {
Expand Down

0 comments on commit 608f882

Please sign in to comment.