Closed
Bug 1219461
Opened 9 years ago
Closed 8 years ago
Replace PRLogModuleInfo usage with LazyLogModule
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
firefox44 | --- | affected |
People
(Reporter: erahm, Unassigned)
References
(Blocks 1 open bug)
Details
+++ This bug was initially created as a clone of Bug #1174785 +++
In order to fix various TSan issues and advance the goal of switching away from NSPR logging we need to replace the direct usage of PRLogModuleInfo.
I'll file blocking bugs for doing this within various components.
The following patterns will need to be handled, making this a little tricky to automate. As of filing this there are about 260 instances to replace.
File Scoped Global
==================
> PRLogModuleInfo* (s|g|k)FooLogger;
> ....
> void Foo::Foo()
> if (!sFooLogger) fooLogger = PR_NewLog("FooLogger");
This would become:
> LazyLogModule (s|g|k)FooLogger("FooLogger");
File Scoped Getter Function
===========================
> PR_LogModuleInfo* GetFooLogger() {
> static (s|g)?(F|f)ooLogger = nullptr;
> if (!fooLogger) fooLogger = PR_NewLog("FooLogger");
> return fooLogger;
> }
> ...
> void blah() { MOZ_LOG(GetFooLogger(), ...); }
This would become:
> LazyLogModule sFooLogger("FooLogger");
> ...
> void blah() { MOZ_LOG(sFooLogger, ...); }
Note: all |GetFooLogger| calls would need to replaced
External variations
===================
Some areas declare an |extern PRLogModuleInfo* sFooLogger|, these would need to be updated as well.
Reporter | ||
Comment 1•8 years ago
|
||
All blockers are complete.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•