Created
February 12, 2022 20:04
-
-
Save maverick1872/021b33f2b90f17e102d34bcd92207fcb to your computer and use it in GitHub Desktop.
Splat optimizations cause metadata to be dropped when not leveraging `winston.formats.splat()`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const logger = winston.createLogger({ | |
level: "debug", | |
defaultMeta: { id: 'APP', service: 'Authentication' }, | |
transports: [mockTransports.inMemory(actualOutput)] | |
}); | |
logger.info('this is a test', { extraThing: 7 }); | |
logger.info('this is %c a test', { extraThing: 7 }); | |
assume(actualOutput.every((msg) => | |
msg.hasOwnProperty("extraThing") | |
)).is.true("Not all messages include the additional metadata") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment