-
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
logger prints/output only first argument in v 3.2.0 #1614
Comments
What formatters and other config are you using? In particular, handling of splats/metadata has changed from 3.0 to 3.2. |
@DABH Can I get to see the change details w.r.t 3.2 ?
|
You could log like That being said, I think winstonjs/logform#85 with the |
I think this is such a breaking change... The partial solution is: const wrapper = ( original ) => {
return (...args) => {
for (let index = 0; index < args.length; index++) {
if(args[index] instanceof Error){
args[index] = args[index].stack
}
}
original(args.join(" "))
}
};
logger.error = wrapper(logger.error);
logger.warn = wrapper(logger.warn);
logger.info = wrapper(logger.info);
logger.verbose = wrapper(logger.verbose);
logger.debug = wrapper(logger.debug);
logger.silly = wrapper(logger.silly); |
But |
agree, it's the break change. the |
Definitely a breaking change. Also the wrapper works in a very limited way. |
Environment
winston
version?[email protected]
node -v
outputs:v10.13.0
Problem
logger.info('First', 'Second')
is printing onlyFirst
in the console and in File.With
3.0
, this is printing both arguments,First
&Second
. (Second
in the new line)What do you expect to happen instead?
Expecting output as
First
Second
The text was updated successfully, but these errors were encountered: