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

Support LOG_LEVEL expression #3

Open
JesusTheHun opened this issue Nov 30, 2023 · 0 comments
Open

Support LOG_LEVEL expression #3

JesusTheHun opened this issue Nov 30, 2023 · 0 comments

Comments

@JesusTheHun
Copy link

Right now if you set LOG_LEVEL=debug you will only see debug statements.
Changes are, if you are debugging, you are also interested in errors, even warning, maybe info ? You get the gist.

I expected that setting the log level to info would also display all messages "above" info. Changing the current behaviour would be a breaking change, so what about expressions ?

# Ideas of syntaxes
LOG_LEVEL=info+ node ./app.js # info and anything above
LOG_LEVEL=debug:warning node ./app.js # anything between debug and warning, both included

# More verbose syntaxes but don't rely on a hierarchy
LOG_LEVEL="debug|info|warning|error" node ./app.js . # The pipe is a bash operator so we have to use quotes. But the pipe is a common operation for "or".
LOG_LEVEL=debug,info,warning,error node ./app.js # Doesn't need quotes, maybe less readable ?

If we allow to set multiple levels, we can actually allow any character that is not a letter as a separator.

I'm willing to submit a PR for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant