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

LOG_LEVEL more verbose than notice with LOG_DEBUG="-..." does not work #19

Closed
nathannau opened this issue Dec 13, 2022 · 2 comments
Closed

Comments

@nathannau
Copy link

I don't know if this is intentional, but when LOG_LEVEL is set to "debug" or "info", LOG_DEBUG is ignored.

@nathannau
Copy link
Author

nathannau commented Dec 13, 2022

In fact the problem arises when the logger is instantiated globally in an imported file.

`file.ts
import log from "log";
const myLogger = log.get("myLogger");

export function myTest() { myLogger.info('info') }
`

.env LOG_LEVEL="debug" DEBUG="-myLogger"

@medikoo
Copy link
Owner

medikoo commented Dec 13, 2022

@nathannau to clarify:

  1. LOG_LEVEL=debug will enable all logs (including all debug logs), and then via LOG_DEBUG we can only decide which namespaces should not be shown (e.g. LOG_LEVEL=debug LOG_DEBUG=-db will result in showing all debug logs aside of those coming from db namespace)
  2. LOG_LEVEL=info will enable all logs down to info level, then via LOG_DEBUG we can decide for which namespaces also debug level logs should be shown

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

2 participants