Logging levels
The amount of log messages is too large and reduces the usefulness of the logged information. Let's find a solution that supports:
- Different logging level (at least debug, info, warn, error)
- Custom module labels (like PHP, ServiceWorker, etc.)
- Filtering the output by level and module
There's an NPM library called debug that's popular.
debug- A tiny JavaScript debugging utility modelled after Node.js core's debugging technique. Works in Node.js and web browsers
https://github.com/debug-js/debug
Maybe has too many features, like assigning unique color to each namespace.
Another NPM library is called log. It's more minimal, and has logging levels as you described.
log- Universal logging utility
https://github.com/medikoo/log
This was a super annoying issue when I was initially working on the service worker, but I never had that problem ever since. The default console levels like warn() or debug() seem to be good enough. If this is ever a problem, let's reopen this issue.