Closed iacore closed 2 years ago
I mean the logger name isn't shown in logged messages with default message format.
const logger = new Logger("abc")
logger.info("hi")
Logger names are somewhat niche and so aren't output by default. However, you can easily setup your console stream to output this. Here's how:
const logger = new Logger("abc");
const consoleStream = new ConsoleStream().withFormat(
new TokenReplacer().withColor().withFormat(
"{logger}: {dateTime} {level} {msg} {metadata}",
),
);
logger.addStream(consoleStream);
logger.info("hello world");
Outputs:
abc: 2022-04-09T20:17:42.373Z Info hello world
I'm not quite following this one? The default logger has a name of "default". You can see this here:
Outputs: