0

I suddenly started getting following error in my nodejs project

[PINODEP008] PinoWarning: prettyPrint is deprecated, look at https://github.com/pinojs/pino-pretty for alternatives.

What to do? App is crashing

(Use `node --trace-warnings ...` to show where the warning was created)
[nodemon] app crashed - waiting for file changes before starting...
Vinit Khandelwal
  • 490
  • 8
  • 20

2 Answers2

3

If you are looking for the solution of [PINODEP008] PinoWarning: prettyPrint is deprecated, look at https://github.com/pinojs/pino-pretty for alternatives, then, I solved the same in my application, as below:

Instead of

pinoHttp: {
    prettyPrint: {
        ignore:'req.headers,res',
    }
}

Updated this:

pinoHttp: {
    transport: {
        target: 'pino-pretty',
        options: {
            ignore:'req.headers,res',
        }
    }
}

Reference: https://github.com/Zialus/TW-Minesweeper-Server/commit/f67ae7e33434fd36d14760f1c5572cefd52bae92

Vidz
  • 545
  • 1
  • 6
  • 16
3

Old way:

prettyPrint: true     

New way:

transport: {
  target: "pino-pretty",
  options: {
    levelFirst: true,
    translateTime: true,
    colorize: true,
  },
},
Tyler2P
  • 2,324
  • 26
  • 22
  • 31