Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom levels comparison #1880

Closed
obrus-corcentric opened this issue Jan 11, 2024 · 5 comments
Closed

Allow custom levels comparison #1880

obrus-corcentric opened this issue Jan 11, 2024 · 5 comments

Comments

@obrus-corcentric
Copy link
Contributor

I need levels to be compatible with syslog.

So override values for example, like this, doesn't work:

Pino({
  level: 'info',
  customLevels: {
    fatal: 2, // crit
    error: 3, // err
    warn: 4, // warn
    info: 6, // information
    debug: 7, // debug
    trace: 8 // trace
  },
})

The main problem here, that in syslog lower number shows more critical level, but in pino it works in opposite order.

So using syslog levels determine fatal as lower than debug and set up level to debug, will show only debug and trace logs.

It would be nice to have ability setup order to compare level values or at least custom comparison function to be able filter logs correct

@mcollina
Copy link
Member

Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.

@jsumners
Copy link
Member

@obrus-corcentric
Copy link
Contributor Author

Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.

#1883

@homersimpsons
Copy link
Contributor

I think this can be closed with both

https://github.com/pinojs/pino-syslog

and

#1883

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants