This way Pino assumes that the options argument was skipped and only a stream argument was provided. This would lead to options never taking any effect.
Now to solve this if I simply interchange the 2 arguments then, Pino complains because we're not taking any Pino specific options from the user regarding those so ultimately we're passing the level, extreme and safe option as undefined to Pino. And Pino by does not set the default values for undefined fields.
So I guess a way to solve this is to provide an attribute called pinoOptions in the aedes-logging API like this -
logging({
instance: instance,
servers: servers,
pinoOptions: {level: info // plus other properties}
})
And then simply pass that object to Pino in index.js -
The Pino constructor has the following API -
But in index.js, Pino is initialised in the following way -
This way Pino assumes that the
options
argument was skipped and only astream
argument was provided. This would lead tooptions
never taking any effect.Now to solve this if I simply interchange the 2 arguments then, Pino complains because we're not taking any Pino specific options from the user regarding those so ultimately we're passing the
level, extreme and safe
option asundefined
to Pino. And Pino by does not set the default values for undefined fields.So I guess a way to solve this is to provide an attribute called
pinoOptions
in the aedes-logging API like this -And then simply pass that object to Pino in index.js -