Skip to content

Conversation

@cslee0034
Copy link
Contributor

Address issue #2370: Fixed the comments in the usage section

const winston = require('winston');

const logger = winston.createLogger({
  level: 'info',
  format: winston.format.json(),
  defaultMeta: { service: 'user-service' },
  transports: [
    //
    // - Write all logs with importance level of `error` or higher to `error.log`
    //   (i.e., error, fatal, but not other levels)
    //
    new winston.transports.File({ filename: 'error.log', level: 'error' }),
    //
    // - Write all logs with importance level of `info` or higher to `combined.log`
    //   (i.e., fatal, error, warn, and info, but not trace)
    //
    new winston.transports.File({ filename: 'combined.log' }),
  ],
});

- Address issue winstonjs#2370: Fixed the comments in the usage section
Copy link
Contributor

@DABH DABH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's always some confusion around "higher" or "lower" when it comes to error level codes... but, the parentheticals here seem to disambiguate what the behavior is going to be, so overall, I am in favor of this PR. Thanks for your contribution.

@DABH DABH merged commit f110f61 into winstonjs:master Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants