-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
winston 3: colorize all including timestamp #1388
Comments
The issue is |
a quick workaround to colorize the whole log line is: const colorizer = winston.format.colorize();
const logger = winston.createLogger({
level: 'debug',
format: combine(
winston.format.timestamp(),
winston.format.simple(),
winston.format.printf(msg =>
colorizer.colorize(msg.level, `${msg.timestamp} - ${msg.level}: ${msg.message}`)
)
),
transports: [
new transports.Console(),
]
}); |
I have a related question here: https://stackoverflow.com/questions/74186705/how-to-preserve-default-syntax-highlighting-colors-in-javascript-console |
I can't find an example of colorizing the entire log line, e.g.,
I would like everything in the entire line colorized. In Winston 2, it seemed to work fine expect it didn't colorize the entire line.
How do I colorize the entire output line and include the timestamp as the first entry of the log line, not as the part of message body.
The text was updated successfully, but these errors were encountered: