-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
lighthouse-logger improvments #6313
Comments
+1 for the first point. I was going to add some verbose timing around driver.sendCommand, but saw that I couldn't query the log level to prevent creating Dates unnecessarily. |
@hoten you can take the first if you want it :) lighthouse-logger is a little unusual in that we publish it from within the lighthouse repo, require it elsewhere in lighthouse off of npm (not locally), but we don't use any tool to handle this for us. In practice, this really only means we have to publish a version before we can make use of it in lighthouse, but since we don't have anything currently relying on being able to query the log level it shouldn't be a problem. |
one other design idea: if (logger.level === 'verbose') { // or whatever
const logValue = expensiveCalculation();
log.verbose('Thing', logValue);
} or we could extend logger to take functions that are only called by lighthouse-logger itself log.verbose('Thing', _ => expensiveCalculation()); and if not at a verbose level, then that function would never be run The benefit would be (I think) less work on the caller side. The downside is it might obscure what's going on. It might also just be unusual enough that it's dumb :) @patrickhulce if you have thoughts |
I'll take this. Spoke to @brendankenny offline. We decided to do just |
I will also expose the time entries to help with #3745. |
First one is long done, haven't needed the second one since then, so no need to track it with an issue :) |
It's kind of annoying to update lighthouse-logger, but there are some rough edges that we'd like to smooth out. Came up in #6297:
verbose
-only logs (e.g. querying things, slicing strings, etc) when it's not needed.verbose
anddefault
(debug
orinfo
perhaps?) that doesn't contain every protocol messageThe text was updated successfully, but these errors were encountered: