#102·signale

Conditional logging based on scope

Author: OmgImAlexisCreated Feb 1, 2020Updated Feb 10, 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

javascript
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.

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

Additional context Essentially I want the namespace filter debug has.