-
Notifications
You must be signed in to change notification settings - Fork 97
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
Logs are colorized everywhere #60
Comments
I agree with your concerns -- it would probably be better if colorizer accepted a |
Have the same problem and the same question "why". Here, if anyone finds my (simplified) example useful: 'use strict';
// IMPORTANT! colors.enabled value must be captured before Winston imported!
const colorsEnabled = require('colors/safe').enabled;
const winston = require('winston');
winston.add(
new winston.transports.Console({
format: winston.format.combine(
colorsEnabled // the rest is pretty much the same idea as @aldofunes
? winston.format.colorize({ all: false })
: winston.format(i => i)(),
winston.format.simple()
)
})
);
winston.warn('Some warning'); @DABH, once I have a chance to do PR, what would be the |
Maybe it's worth to note that unless colors are forced, an app running in a docker container will not produce a colorized output if |
I am having some trouble with the colorizing of logs. Specifically, when logging to non-tty outputs.
There is an override in colorize.js:9 that prevents the
colors
package to enable or disable when supported.First of all, I would like to know why this decision was made, and if it can be removed.
I have made a hack as a workaround. Here it is, in case anyone wants to know how to do it:
The text was updated successfully, but these errors were encountered: