-
Notifications
You must be signed in to change notification settings - Fork 273
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
debug: add ability to specify log levels with log() #1475
Conversation
cc @Evalir @bpierre @andy-hook some feedback welcome! |
Looking good! I was wondering if the currying mode was really needed, rather than having only one way to use it? I can see how it could be useful to do e.g. Also what would you think about making the level a required parameter? I think it could help us to think about the level of every Also wondering if we should have a way to optionally tag them, so we could exclude / include the exact logs we want when developing. For example this // assuming [level, tags] when an array is passed as a first param
log(
['info', ['aragonjs', 'app']],
'Apps updated',
apps
)
// we could also skip the tags by passing a string
log(
'info',
'Apps updated',
apps
) |
You mean being able to exclude certain logs from the console during development? I think this would be inmensely useful, as especially when making changes to the client / an app, the huge amount of logs slows the whole tab down. :) |
No, it was mostly just to hide the first parameter if it wasn't wanted.
Agreed, let's go with that! What do we think about consola? |
@Evalir yes exactly!
It looks perfect! 👍 |
+++ 1, this is going to be very handy! agree with points raised. Consola looks 😎 |
Closing for now; it looks like we reached soft consensus on consola and we can bring it back up at a later point :). |
Bit of an experiment to see how we could add debug levels to our
log()
utility.Took a quick look around npm and I swear something similar to this must exist, but I couldn't find it 🤷♂️. Any suggestions (more battle tested than this one) welcome!
Couldn't come up with an API that felt nice without the transparent binding, so this is inspired somewhat by the
debug
API: