Skip to content

Commit

Permalink
Added ability to configure writable stream
Browse files Browse the repository at this point in the history
  • Loading branch information
bttmly authored and klaudiosinani committed May 18, 2018
1 parent 8d2b0a3 commit d3651e4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion signale.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -80,7 +81,7 @@ class Signale {
}

_log(message) {
process.stdout.write(message + '\n');
this._stream.write(message + '\n');
}

_formatDate() {
Expand Down

0 comments on commit d3651e4

Please sign in to comment.