-
Notifications
You must be signed in to change notification settings - Fork 0
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 levels? #21
Comments
@wmertens done this, just doing some docs |
@wmertens alongside the wip docs for a bunch of other features these are some updates ones in filtering, how's this look? ☕ filteringcomma separated strings, or arrays 🔢 levelfilter by log level as a number with simple comparison operators log.filter('>= 1')
log.level(1).bold('above 1... success').echo()
log.level(0).bold('not above 1...').echo() 🎯 matcherfilter using an log.filter(['canada*'])
log.tag('canada-eh').white('canadian, pass.').echo() more advanced log.filter(['eh*', '!warm', tag => (/ez/).test(tag)])
log.tag('eh').underline('eh').echo()
log.tag('warm').red('warm').echo()
log.tag('ez').yellow('ez').echo() ❗ important to note, if only a function is passed in, it will have the entire log instance passed to the argument, rather than the array of tags (for compatibility & simplicity.) filter & tags
log
.filter('!nope, yes')
log
.tag('unrelated,nope')
.cyan('you will never see me :-(')
.echo()
log
.tag('yes')
.underline('yay!')
.echo() |
Looks 🔥🔥🔥 |
✅ |
instead of
log.tag('verbose')
it would be nicer to use e.g.log.tag(0)
and then set the filter to >1 somehow.Another option may be
const dbg = log.tag('mymodule, debug'); const err = log.tag('mymodule, err');
and then usedbg
anderr
through the file; not sure if they can be reused?The text was updated successfully, but these errors were encountered: