Add optional start time for a MOZ_LOG message
Categories
(Core :: XPCOM, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox74 | --- | fixed |
People
(Reporter: jesup, Assigned: jesup)
Details
Attachments
(1 file)
With the ability to pump log messages into the profiler (MOZ_LOG=...,profilermarkers) being able to provide a time period associated with the message can be useful (and this is frequently used with Text and other markers in the profiler, like the DocumentLoad marker, or DomContentLoaded, etc).
I propose a parallel entry for logging (MOZ_LOG_TIME(), though it could be renamed) which takes an optional start time. We could also be fully explicit and allow/require start and end times when using this API.
For text output, we could include a time range (similar to how we add timestamps for "MOZ_LOG=...,timestamp")
To maximize speed and minimize codesize at callpoints, I've implemented it as largely parallel to the MOZ_LOG calls except at the lowest level (::Print() in logging.cpp). We could merge the two versions at a higher level instead.
Assignee | ||
Comment 1•6 years ago
|
||
an output line would look like this:
2020-01-10 19:20:50.997112 -> 19:20:50.999092 UTC (2ms)- [(null) 14778: Main Thread]: D/nsHttp nsHttpChannel::DoConnect [this=0x82f06000, aTransWithStickyConn=0x0]
Assignee | ||
Comment 2•6 years ago
|
||
Comment 4•6 years ago
|
||
bugherder |
Description
•