Bug 1712678 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

DevTools code usually directly calls console APIs to log. 

When a specific log becomes frequent it can be annoying for users and they have no way to silence it (eg Bug 1712574).

Instead we could use a Logger that would support Log levels and could be driven by preferences (eg similar to what marionette/remote-agent does).

Having logs enabled by default is a very valuable source of feedback, so if we have a Logger we should be careful about disabling them by default. 

We could first implement a logger and gradually replace our console usage with it in DevTools, eventually adding a linter rule to prevent direct console API usage?
DevTools code usually directly calls console APIs to log. 

When a specific log becomes frequent it can be annoying for users and they have no way to silence it (eg Bug 1712574).

Instead we could use a Logger that would support Log levels and could be driven by preferences (eg similar to what marionette/remote-agent does). The preference would describe the minimum level of log that should be logged. For reference, the marionette logger uses the following (ordered) list of log levels: "fatal" > "error" > "warn" > "config" > "debug" > "trace" > "info". We might reuse or use a simplified version (the ordering of the lower levels seems a bit random, config/debug/trace/info all feel on the same "level" and are rather categories IMO). 

If a log becomes temporarily spammy, we could advise users to change the preference `devtools.log.level` to a higher level.

Having logs enabled by default is a very valuable source of feedback, so if we have a Logger we should be careful about disabling them by default. 

We could first implement a logger and gradually replace our console usage with it in DevTools, eventually adding a linter rule to prevent direct console API usage?

Back to Bug 1712678 Comment 0