MOZ_LOG doesn't allow module names with the dot character
Categories
(Core :: XPCOM, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox75 | --- | fixed |
People
(Reporter: kats, Assigned: kats)
Details
Attachments
(1 file)
I tried making a LazyLogModule with a name like apz.mgr
and while it didn't give me any errors, setting MOZ_LOG="apz.mgr:5" didn't produce the expected output. Turns out the code that parses the env var uses a Tokenizer that splits "words" and so the .
splits apz.mgr:5
into three words instead of doing what I expected.
If this is intentional it should be documented on the MDN page and if it's not then I can provide a patch to fix by adding .
to the set of allowed word characters.
erahm, thoughts?
Comment 1•4 years ago
|
||
Allowing a .
in a log name seems reasonable. I'm okay with adding support for this, but one thing to check is whether that messes with setting the log level at runtime via prefs. Please update the tests when you make this change.
Assignee | ||
Comment 2•4 years ago
|
||
Thanks. I'll put up a patch shortly. I tested setting prefs like logging.apz.mgr = 5
and it does have the desired effect (as I would expect from reading the relevant code as well).
Updated MDN page as well: https://wiki.developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Gecko_Logging$compare?locale=en-US&to=1608910&from=1588892
Assignee | ||
Comment 3•4 years ago
|
||
Updated•4 years ago
|
Pushed by kgupta@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4d34791140cb Allow dot characters in log module names. r=erahm
Comment 5•4 years ago
|
||
bugherder |
Description
•