-
Notifications
You must be signed in to change notification settings - Fork 823
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
More control over enabling/disabling debug logging #1619
Comments
The general approach to changing the log level is at https://developers.google.com/web/tools/workbox/guides/configure-workbox#configure_log_levels This is fairly straight forward when using If you'd like to do the same in We're of the opinion that the logs can catch a lot of problems during the development cycle that you'd otherwise run into during production, and given that there is a workaround, making it much easier than that to disable them on |
@jeffposnick What do you think about adding a |
@jeffposnick and by the way, |
We have the reverse issue: We would like to show workbox debug messages on a deployed server, and this is also not possible. Please reopen this and add debug level configuration as a option regardless of host. |
@ImanMh,
@jeffposnick's comment above was made before v4 was released, but everything else he said is still true today. You can see the debug level logs by configuring devtools to show them. |
Is there a workaround to remove those logs if you're using firefox? Workbox messages polute the console, this |
please give us a way to prevent all this noise in the devtools |
We're re-opening this issue due to continued feedback from the community asking for alternatives. In Workbox v5, this debug logging is enabled/disabled based on the value of (There are a number of service worker "gotchas" that the debug logging helps you avoid, and I feel pretty strongly that we should keep logs enabled by default for development builds until someone takes the affirmative step of disabling them.) |
The mechanics of this are a little tricky in v5, when folks are pulling in specific pieces of the Workbox runtime and won't necessarily have direct access to a hypothetical method like So we're going to go ahead with an approach that relies on a global We're still, by default, going to enable the logs, so you'd have to specifically disable them, rather than the other way around. |
What about production builds, though? I'd like to be able to include the logs on our staging environments (and only keep them turned off for the live environment). I tried setting |
Workbox uses When using the |
Just in case, filtering workbox using console filters seems to do not work |
Currently, it's not possible to disable debugging logs in localhost, and it's a very annoying experience. It would be nice to allow adding a
debug
option toGenerateSW
configuration and, since we're here, customising log level should also be possible.The text was updated successfully, but these errors were encountered: