You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there is an additional string parameter that is not insert via %s into the message template, its characters are inserted individually as properties into the result:
const{createLogger, format, transports}=require('winston');constlogger=createLogger({level: 'info',format: format.combine(format.splat(),format.json()),transports: [newtransports.Console()],});logger.error('one %s','two','three');// {"0":"t","1":"h","2":"r","3":"e","4":"e","level":"error","message":"one two"}
While this is in compliance with the documentation at https://github.com/winstonjs/logform#splat it is still not expected. The behavior should be aligned to what console.log() does where additional parameters are just printed as they are.
Issue #51 suggests that they should be collected into a meta-property which would also be fine as they could then be used in a custom printf transformation.
If there is an additional string parameter that is not insert via
%s
into the message template, its characters are inserted individually as properties into the result:While this is in compliance with the documentation at https://github.com/winstonjs/logform#splat it is still not expected. The behavior should be aligned to what
console.log()
does where additional parameters are just printed as they are.Issue #51 suggests that they should be collected into a
meta
-property which would also be fine as they could then be used in a custom printf transformation.Versions:
[email protected]
[email protected]
The text was updated successfully, but these errors were encountered: