Define log modules statically from a yaml list
Categories
(Core :: XPCOM, task)
Tracking
()
People
(Reporter: dcarver, Assigned: dcarver)
References
(Blocks 1 open bug)
Details
Generate a sorted, constinit list of log modules from a LogModules.yaml file. Look it up in LogModuleManager::CreateOrGetModule before creating a dynamic module. Add StaticLogModule (and mozilla::logmodules::<name> headers) so that C++ code can refer to these modules directly.
LogModule::Get, every LazyLogModule, a JS console's logModule and LogModuleManager::Init (once for each MOZ_LOG term) all go through CreateOrGetModule. So a module in the list would always exist before any of them looks it up.
This lets a module declare settings that have to be known when it is created. One example is whether its profiler markers are filtered out by default (bug 2084269). Today a LazyLogModule can't carry such a setting:
- Two
LazyLogModules with the same name could disagree. - The module is created by whichever lookup comes first: one of those
LazyLogModules, anotherLogModule::Getcaller, orMOZ_LOGat startup. Once the module exists, a later declaration can't change its default without overriding an explicitMOZ_LOGsetting.
With a single static declaration per module, creation order no longer matters, and there is only one place to state the default. Modules that are not in the list keep today's behaviour and emit markers by default.
For now, every module emits markers by default, and the Default case of LogModule::SetMarkers refers to this bug.
Description
•