Make LogModule::Get reject log module names that MOZ_LOG can't parse
Categories
(Core :: XPCOM, enhancement)
Tracking
()
People
(Reporter: dcarver, Assigned: dcarver)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
Attachments
(1 external file)
Plan:
- Consider changing the MOZ_LOG parser so that space is no longer a delimiter and trailing spaces are trimmed?
- Rename the modules that cannot be controlled through MOZ_LOG:
Login crypto,Login storage(crypto-SDR.sys.mjs, storage-geckoview.sys.mjs)*** PurgeTrackerService:(PurgeTrackerService.sys.mjs)ML:OpenAIPipeline,ML:LlamaCppPipeline(OpenAIPipeline.mjs, LlamaCppPipeline.mjs)SQLite JSM (<connection>)(Sqlite.sys.mjs)URLBar - <name>(UrlbarShared.mjs),Places - <name>(PlacesUtils.sys.mjs)3pcbexception(ThirdPartyCookieBlockingExceptions.cpp), whichMOZ_LOGstops at because of its leading digit (or make MOZ_LOG accept it?)
- Make
LogModule::Getreturnnullptr, with a warning, for invalid names. - Handle
nullptrin the callers that use the module without checking it:LogModulePrefWatcher,Console,LogModuleManager::Initand SpiderMonkey'sGetLoggerByName.
Comment 1•1 month ago
|
||
The severity field is not set for this bug.
:nika, could you have a look please?
For more information, please visit BugBot documentation.
| Assignee | ||
Comment 3•1 month ago
|
||
Bug 2084142 replaces this plan. Log module names now match by a key in ASCII lowercase that keeps only letters, digits, _, - and ., so modules such as Login crypto or *** PurgeTrackerService: can be configured without being renamed, and LogModule::Get no longer needs to reject names. Bug 2080769 covers spaces in names.
The one module still out of reach is 3pcbexception: MOZ_LOG doesn't accept a name starting with a digit.
| Assignee | ||
Updated•25 days ago
|
| Assignee | ||
Comment 4•20 hours ago
|
||
LazyLogModule names are checked at compile time, but LogModule::Get also gets
names at runtime, from the logModule or the prefix of the JS consoles, the
logging.<name> prefs and SpiderMonkey's loggers. A name that isn't a valid log
module name, as IsValidLogModuleName tells, can't be set in MOZ_LOG, so DEBUG
builds now report it with a warning. The module is still created and
returned, so the callers don't change.
The check runs before CreateOrGetModule takes mModulesLock: NS_WARNING records
a profiler marker, which must not happen under that lock.
Description
•