-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Workbox debug messages clutter console #170
Comments
You're right. Tying this to There is only really one config option, So either we add a filter specifically for debug, or we add a constant for debug. Alternatively, what about using the This is particularly appropriate here because here it is forcing the use of non-production Workbox files, which is what the constant does in core as well. |
🤔 I typically leave I can't think of any tangible consequences to leaving it off most of the time, so tying Workbox's Although, if I were trying to debug something w/ the bundled version of React or whatnot, I probably still wouldn't want Workbox stuff cluttering the console, so there does seem to be a fundamental difference between "i want source files instead of compiled" and "i want workbox debug messages", even if there's sometimes overlap in the context of working on PWAs. So, I think a filter/constant specifically for Workbox debugging would probably be ideal IMO, but using |
In regards to the log levels, I just saw this in Migrate from Workbox v3 to v4:
|
Otherwise, with the changes in #173 I can indeed set |
@felixarntz What do you think of adding a new |
Related: GoogleChrome/workbox#2284 |
We should be able to now to define |
Now that Workbox v5 is almost ready for release, there is now a mechanism available to disable the logging. See #173 for the proposed constant to opt-in to the logging which is only enabled now if |
Problem
Workbox's
debug
mode is currently tied toWP_DEBUG
:https://github.com/xwp/pwa-wp/blob/a4bcf446cda9f6e308da356eb665668bb9c5831f/wp-includes/components/class-wp-service-worker-configuration-component.php#L69-L70
The messages from Workbox are so noisy that they clutter the log to the point where it's very distracting, and almost unusable for me. That's still the case with the 700+
console.debug
messages filtered off, so that onlyconsole.log
messages are being displayed.I think the devex here should conform to the same principle that the UX would: under normal circumstances, nothing should be output to the console. For developers, having
WP_DEBUG
enabled is a normal circumstance. I should only see Workbox logging when I explicitly enable it, in order to debug something.Potential Solution
Ideally, I don't think this should be tied to
WP_DEBUG
at all, but should have a separate constant likeWORKBOX_DEBUG
.At the very least, though, there should be a filter around
$options
so that developers can disable that for themselves.I haven't thought a lot about the proper way to solve this, though, so I'm not strongly tied to either of those, they were just the first ideas that came to mind.
The text was updated successfully, but these errors were encountered: