Closed pan93412 closed 3 years ago
pino
default log level is info
.
pino
instance log level means the log allow to log.
pino
transport log level means the lowest level it can be received from instance.
If the instance log level is higher than transport log level, some of the log will be missing for transport.
This behavior is expected when using either transport
or multistream
.
https://github.com/pinojs/pino/blob/master/docs/api.md#pinomultistreamoptions--stream
pino
default log level isinfo
.
pino
instance log level means the log allow to log.pino
transport log level means the lowest level it can be received from instance.If the instance log level is higher than transport log level, some of the log will be missing for transport.
This behavior is expected when using either
transport
ormultistream
. https://github.com/pinojs/pino/blob/master/docs/api.md#pinomultistreamoptions--stream
So should I do this instead?
const pino = require('pino');
const transport = pino.transport({
level: "trace",
target: 'pino/file',
});
const log = pino({ level: "trace"}, transport);
log.error("Error!");
log.warn("Warn!");
log.info("Info!");
log.debug("Debug!");
log.trace("Trace!");
It seems working when passing {level: "trace"}
to pino()
pino
default log level isinfo
.pino
instance log level means the log allow to log.pino
transport log level means the lowest level it can be received from instance. If the instance log level is higher than transport log level, some of the log will be missing for transport. This behavior is expected when using eithertransport
ormultistream
. https://github.com/pinojs/pino/blob/master/docs/api.md#pinomultistreamoptions--streamSo should I do this instead?
const pino = require('pino'); const transport = pino.transport({ level: "trace", target: 'pino/file', }); const log = pino({ level: "trace"}, transport); log.error("Error!"); log.warn("Warn!"); log.info("Info!"); log.debug("Debug!"); log.trace("Trace!");
It seems working when passing
{level: "trace"}
topino()
Yes.
Thanks a lot!
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Environment
I'm in
darwin/arm64
.Description
Consider this code:
I expected it can print the log with the range from "error" to "trace"; however, it only prints the log with "error", "warn" and "info" level.
Expected Result
It would be worked like this code:
```js const pino = require('pino'); const log = pino({ level: "trace" }); log.error("Error!"); log.warn("Warn!"); log.info("Info!"); log.debug("Debug!"); log.trace("Trace!"); ```Actual Result