-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
BugGood First IssueGood issue for new contributorsGood issue for new contributorsHelp WantedAdditional help desired from the communityAdditional help desired from the community
Description
It is easy to write the following code and not realize that one has made a mistake:
const logger = winston.createLogger({
levels: { eeny: 0, meeny: 1, miney: 2, moe: 3},
transports: [
new winston.transports.Console(),
]
});
logger.meeny('catch a tiger by the toe'); // never hollersThis could be addressed by the following check in the Logger constructor:
if (!Object.keys(this.levels).includes(this.level)) {
throw new Error(`Logger level ${this.level} is not in the levels: ${this.levels}`);
}I can open a PR if people agree it is worth fixing.
Metadata
Metadata
Assignees
Labels
BugGood First IssueGood issue for new contributorsGood issue for new contributorsHelp WantedAdditional help desired from the communityAdditional help desired from the community