Open Bug 2078666 Opened 1 month ago Updated 1 month ago

Parse MOZ_LOG module lists in one place, in C++

Categories

(Core :: XPCOM, task)

task

Tracking

()

ASSIGNED

People

(Reporter: dcarver, Assigned: dcarver)

References

(Blocks 3 open bugs)

Details

Attachments

(5 external files, 1 obsolete file)

The MOZ_LOG syntax (name:level,name:level, plus options such as timestamp) is parsed in two places:

They disagree:

  • Login crypto:5: JS configures one module, Login crypto (Verbose), but C++ configures two, Login (Error) and crypto (Verbose). (Login crypto is not the only example with special characters)
  • timestamp, nsHttp:5: JS configures a new module nsHttp (with a leading space), but C++ configures nsHttp (without a leading space).

We should have a single parser in C++, exposed to chrome JS (for example ChromeUtils.parseLogModules()), and make about:logging use it. The behavior of MOZ_LOG should not change.

Blocks: 2079145

NSPRLogModulesParser now calls its callback with a LogModulesEntry, which is
either a log module with its level or one of the MOZ_LOG options, each with
its own type. The options are listed once, so LogModuleManager::Init and the
Windows sandbox broker no longer compare option names themselves.

The tokenizer is unchanged, and so is the behavior of MOZ_LOG.

This exposes NSPRLogModulesParser to chrome JS, so that front-end code can
parse MOZ_LOG strings the way the C++ code does, with log modules and options
apart.

about:logging split the log modules on commas, so it disagreed with MOZ_LOG
on strings such as "Login crypto:5" or "timestamp, nsHttp:5", on log modules
without a level, and on options it didn't know, such as "raw", which it set
as log modules. It now uses the same parser as MOZ_LOG.

The web-compat preset is rewritten without spaces after ':', which the MOZ_LOG
syntax doesn't allow.

Searching for "EME" in the string also enabled logging for EME:0 and for any
module containing EME.

ParseLoggerOptions in js/src/shell/js.cpp is still parsing on its own. Reusing the same parser there means rewriting it without xpcom.

Attachment #9655956 - Attachment description: WIP: Bug 2078666 - Check the EME log module of MOZ_LOG with ChromeUtils.parseLogModules. r?#media-playback-reviewers → WIP: Bug 2078666 - Log the WMF CDM origins list through the console's EME log module. r?#media-playback-reviewers
See Also: → 2079751
See Also: → 2080173

Comment on attachment 9655956 [details]
WIP: Bug 2078666 - Log the WMF CDM origins list through the console's EME log module. r?#media-playback-reviewers

Revision D331975 was moved to bug 2080173. Setting attachment 9655956 [details] to obsolete.

Attachment #9655956 - Attachment is obsolete: true
See Also: → 2080769
Blocks: 2084269
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: