pinojs / pino-http

🌲 high-speed HTTP logger for Node.js
MIT License
539 stars 116 forks source link

fix: set error param as optional for options.customLogLevel #265

Closed raiman264 closed 1 year ago

raiman264 commented 1 year ago

according to API docs the error param in customLogLevel function is optional but that is not reflected in the typescript definition

customLogLevel: set to a function (req, res, err) => { / returns level name string / }. This function will be invoked to determine the level at which the log should be issued (silent will prevent logging). This option is mutually exclusive with the useLevel option. The first two arguments are the HTTP request and response. The third argument is an error object if an error has occurred in the request.