Open Nokel81 opened 6 years ago
@Nokel81 it's JS, which means you can always obtain it by your self :D (one non trivial advantage of dynamic languages VS static ones)
start with a simple:
winstonTransports.push(new winston.transports.Console({
[...]
formatter: function (options) {
console.log('options: ', options);
return options;
}
});
or just simply place a debugger
before the console.log
, open a remote debug session and have fun :D
I have to do that with a process.stdout.write
command else I get a maximum stack size crash. Yes I can do that but might not every possible option be there always?
weird, just ran it on a project of mine and got the expected:
formatter options: { colorize: true,
json: false,
level: 'debug',
message: 'App setup done, loaded layers: [...]',
meta: {},
stringify: undefined,
timestamp: [Function: tsFormat],
showLevel: true,
prettyPrint: false,
raw: false,
label: null,
logstash: false,
depth: null,
formatter: [Function: formatter],
align: false,
humanReadableUnhandledException: false }
perhaps you sent in an object with recursive references?
And well, I guess there might be some enumerable: false
property (even if currently looking for then in winston's codebase is an empty set: https://github.com/winstonjs/winston/search?q=enumerable&type=Code).
But even in that case:
hidden
hardly will be reported in an eventual schema@Nokel81 are you using winston@2
or winston@3
?
I am using winston@3
Interesting – just to be clear if you are talking about filter or
rewritersfrom
winston@2` please see the Upgrade Guide.
Defining and documenting the schema of info
objects in winston@3
(and what formats add what properties) would be very useful documentation. Will leave this open as a way to track those docs.
When writing my own custom formatter it would very useful to know the schema for the options object that is passed to the formatter. Does this exist already or would it be possible to be made?