Adding Level Decorators and an option to Send Debug to StdOut #127

wants to merge 3 commits into


None yet

2 participants


This pull request has two key changes:

  • Adding Level Decorators
  • Adding a flag to send Debug level messages to StdOut

I'm not expecting the Pull Request as is to be accepted, but rather, to start the dialog about these proposals and to shape how they go from here.

LevelDecorators are an option on creating your transport that allow you to set the start and end characters for the decoration. For example:

transports.push(new winston.transports.Papertrail({
    levelDecorators: ['[', ']'],
    level: options.level,
    port: options.port,
    program: options.program

Similarly, for the Console transport, I've proposed a debug level to stdout as it was biting us in the ass to have non-linear levels going to different pipes, i.e. debug, verbose, info, warn, error as your levels in order of severity.

transports.push(new winston.transports.Console({
    levelDecorators: ['[', ']'],
    level: options.level,
    colorize: true,
    timestamp: true,
    debugToStdOut: true


@kenperkins kenperkins commented on the diff Apr 11, 2012
: true;
+ //
+ // For now this is a hack as I'm still figuring out what I want
+ // the decorators to look like
+ //
+ if (options.levelDecorators && options.levelDecorators.length == 2) {
kenperkins Apr 11, 2012 Contributor

I'd love some suggestions on a better data structure for the decorators.


I agree that dealing with output formatting is a huge pain point in the winston console transport, but I don't know that this is the right answer.

I'm going to close this one, but this is definitely something that could use some thought, and I appreciate the PR.

@jfhbrook jfhbrook closed this Oct 19, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment