PinoWarning:prettyPrint 已弃用,请查看 https://github.com/pinojs/pino-pretty 寻找替代方案

Vin*_*wal 0 node.js npm pinojs

我突然开始在我的nodejs项目中出现以下错误

[PINODEP008] PinoWarning: prettyPrint is deprecated, look at https://github.com/pinojs/pino-pretty for alternatives.
Run Code Online (Sandbox Code Playgroud)

该怎么办?应用程序崩溃

(Use `node --trace-warnings ...` to show where the warning was created)
[nodemon] app crashed - waiting for file changes before starting...
Run Code Online (Sandbox Code Playgroud)

小智 5

老办法:

prettyPrint: true     
Run Code Online (Sandbox Code Playgroud)

新方法:

transport: {
  target: "pino-pretty",
  options: {
    levelFirst: true,
    translateTime: true,
    colorize: true,
  },
},
Run Code Online (Sandbox Code Playgroud)