Skip to content
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 logging toggle via global boolean #2282

Merged
merged 4 commits into from
Nov 21, 2019
Merged

Conversation

jeffposnick
Copy link
Contributor

R: @philipwalton

Fixes #1619

I'm going with self.__WB_DISABLE_DEBUG_LOGS for the global runtime toggle, and disableDebugLogs as the generateSW option name to set the initial value in a generated service worker.

Copy link
Member

@philipwalton philipwalton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes LGTM. The only comment I have is I'm not sure I like the __WB_DISABLE_DEBUG_LOGS name. I think it could potentially sound to some like it's only disabling the DEBUG level logs—and not all logs.

I think my name preference, in order, would be as follows (but if you strongly prefer the current name over these suggestions, I'm happy to go with this):

  1. __WB_DISABLE_LOGS
  2. __WB_DISABLE_DEV_LOGS
  3. __WB_DISABLE_DEBUG_LOGS

@jeffposnick
Copy link
Contributor Author

I'd be more inclined to go with __WB_DISABLE_DEV_LOGS, since __WB_DISABLE_LOGS makes it sound like we also wouldn't log on errors (which we still do).

@coveralls
Copy link

coveralls commented Nov 21, 2019

Coverage Status

Coverage remained the same at 79.433% when pulling 7a8eb18 on debug-logging-toggle into ebaa981 on master.

@workbox-pr-bot
Copy link
Collaborator

PR-Bot Size Plugin

Changed File Sizes

File Before After Change GZipped
packages/workbox-window/build/workbox-window.dev.umd.js 41.92 KB 42.03 KB +0% 9.32 KB

New Files

No new files have been added.

All File Sizes

View Table
File Before After Change GZipped
packages/workbox-background-sync/build/workbox-background-sync.prod.js 3.87 KB 3.87 KB 0% 1.60 KB
packages/workbox-broadcast-update/build/workbox-broadcast-update.prod.js 1.33 KB 1.33 KB 0% 736 B
packages/workbox-build/build/_types.js 41 B 41 B 0% 61 B
packages/workbox-build/build/generate-sw.js 2.75 KB 2.75 KB 0% 1.23 KB
packages/workbox-build/build/get-manifest.js 1.60 KB 1.60 KB 0% 779 B
packages/workbox-build/build/index.js 613 B 613 B 0% 344 B
packages/workbox-build/build/inject-manifest.js 4.93 KB 4.93 KB 0% 1.90 KB
packages/workbox-cacheable-response/build/workbox-cacheable-response.prod.js 608 B 608 B 0% 354 B
packages/workbox-cli/build/app.js 4.16 KB 4.16 KB 0% 1.64 KB
packages/workbox-cli/build/bin.js 940 B 940 B 0% 502 B
packages/workbox-core/build/workbox-core.prod.js 6.89 KB 6.89 KB 0% 2.85 KB
packages/workbox-expiration/build/workbox-expiration.prod.js 3.01 KB 3.01 KB 0% 1.30 KB
packages/workbox-google-analytics/build/workbox-offline-ga.prod.js 1.97 KB 1.97 KB 0% 914 B
packages/workbox-navigation-preload/build/workbox-navigation-preload.prod.js 657 B 657 B 0% 320 B
packages/workbox-precaching/build/workbox-precaching.prod.js 5.62 KB 5.62 KB 0% 2.14 KB
packages/workbox-range-requests/build/workbox-range-requests.prod.js 1.63 KB 1.63 KB 0% 807 B
packages/workbox-routing/build/workbox-routing.prod.js 3.10 KB 3.10 KB 0% 1.35 KB
packages/workbox-strategies/build/workbox-strategies.prod.js 4.10 KB 4.10 KB 0% 1.13 KB
packages/workbox-streams/build/workbox-streams.prod.js 1.44 KB 1.44 KB 0% 696 B
packages/workbox-sw/build/workbox-sw.js 1.34 KB 1.34 KB 0% 745 B
packages/workbox-webpack-plugin/build/generate-sw.js 4.72 KB 4.72 KB 0% 1.76 KB
packages/workbox-webpack-plugin/build/index.js 349 B 349 B 0% 255 B
packages/workbox-webpack-plugin/build/inject-manifest.js 6.75 KB 6.75 KB 0% 2.22 KB
packages/workbox-window/build/workbox-window.dev.umd.js 41.92 KB 42.03 KB +0% 9.32 KB
packages/workbox-window/build/workbox-window.prod.umd.js 4.54 KB 4.54 KB 0% 1.85 KB

Workbox Aggregate Size Plugin

3.54KB gzip'ed (24% of limit)
8.07KB uncompressed

@jeffposnick jeffposnick merged commit 4000e1e into master Nov 21, 2019
@jeffposnick jeffposnick deleted the debug-logging-toggle branch November 21, 2019 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

More control over enabling/disabling debug logging
4 participants