pinojs / pino-http

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

make typesafe custom level loggers great again #319

Closed naseemkullah closed 10 months ago

naseemkullah commented 10 months ago

pass in logger's generic based on value of customLevels and/or logger.customLevels option

fixes #317 and supersedes https://github.com/pinojs/pino-http/pull/318 if merged

cc @UndefinedBehaviour @GeoffreyEmerson

UndefinedBehaviour commented 10 months ago

Hey I think this would allow unknown properties e.g. stuff like const myShinyLogger = pinoHttp({ customLevels: { bark: 25 }, misspelledProperty: 'noot noot' });. What do you think? Am I missing something?

naseemkullah commented 10 months ago

Hey I think this would allow unknown properties e.g. stuff like const myShinyLogger = pinoHttp({ customLevels: { bark: 25 }, misspelledProperty: 'noot noot' });. What do you think? Am I missing something?

good catch, thanks! will convert to draft until thats sorted out

naseemkullah commented 10 months ago

superseded by #318