Skip to content

Commit

Permalink
log scsynth stdout messages with ERROR|FAILURE as errors to stderr
Browse files Browse the repository at this point in the history
So they show up in friendly alarming red on the command line regardless
of your logging level.
  • Loading branch information
crucialfelix committed Apr 21, 2016
1 parent 1a1fa28 commit 0009107
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,16 @@ export class Server extends EventEmitter {
this.log.err(o);
}
}, (err) => this.log.err(err));
this.stdout.subscribe((o) => this.log.stdout(o), (o) => this.log.stderr(o));
this.stdout.subscribe((o) => {
// scsynth doesn't send ERROR messages to stderr
// if ERROR or FAILURE in output then redirect as though it did
// so it shows up in logs
if (o.match(/ERROR|FAILURE/)) {
this.log.stderr(o);
} else {
this.log.stdout(o);
}
}, (o) => this.log.stderr(o));
this.processEvents.subscribe((o) => this.log.dbug(o), (o) => this.log.err(o));
}

Expand Down

0 comments on commit 0009107

Please sign in to comment.