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

Conditional logging based on scope #102

Open
OmgImAlexis opened this issue Feb 1, 2020 · 1 comment
Open

Conditional logging based on scope #102

OmgImAlexis opened this issue Feb 1, 2020 · 1 comment

Comments

@OmgImAlexis
Copy link

OmgImAlexis commented Feb 1, 2020

Is your feature request related to a problem? Please describe.
With larger applications it can be easier to have just a single scope logging while you debug, etc.

Describe the solution you'd like

log.update({ scope: 'a:b:c' }); // Only a:b:c scope
log.update({ scope: 'a:*' }); // `a` and all child scopes
log.update({ scope: '*' }); // Default value

The suggested way to use this would be like so.

if (process.env.DEBUG) {
	log.update({ scope: process.env.DEBUG });
}

Additional context
Essentially I want the namespace filter debug has.

@Oxicode
Copy link

Oxicode commented Feb 10, 2020

+1

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