-
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
Colorize with uppercase level creates lots of blank lines before log message #1345
Comments
... not 100% the right approach to add this feature. The underlying |
@kingjerod this should be fixed by winstonjs/logform#34. Once that lands you can solve this by: const custom = format.printf((info) => {
return `${info.level}: ${info.message}`;
});
const log = createLogger({
format: format.combine(
format(info => {
info.level = info.level.toUpperCase()
return info;
})(),
format.colorize(),
custom
),
transports: [new transports.Console()]
}); |
I still have this bug with wintston@3.4.0 shipped with logform@2.3.2 (this tag has been push 2 days ago). Do I miss something ? |
@Baptiste-Garcin
|
Please tell us about your environment:
winston
version?_winston@2
winston@3.0.0-rc6
node -v
outputs: v10.1.0What is the problem?
Using a custom format that uppercases the level with colorize will cause the log line output to have lots of empty space before it (clears my console so probably 50+ empty lines).
What do you expect to happen instead?
Ideally the upper cased level would be colorized. Worst case is it would not be colorized.
Other information
Here is the code:
It works fine if I do
.toLowerCase()
The text was updated successfully, but these errors were encountered: