Closed
Bug 94922
Opened 23 years ago
Closed 23 years ago
Implement NSPR Logging for plugin module (and clean up tabs)
Categories
(Core Graveyard :: Plug-ins, defect, P3)
Core Graveyard
Plug-ins
Tracking
(Not tracked)
VERIFIED
FIXED
mozilla0.9.4
People
(Reporter: peterlubczynski-bugs, Assigned: peterlubczynski-bugs)
Details
Attachments
(6 files)
148.44 KB,
patch
|
Details | Diff | Splinter Review | |
193.77 KB,
patch
|
Details | Diff | Splinter Review | |
195.88 KB,
patch
|
Details | Diff | Splinter Review | |
191.93 KB,
patch
|
Details | Diff | Splinter Review | |
195.89 KB,
patch
|
Details | Diff | Splinter Review | |
149.84 KB,
patch
|
Details | Diff | Splinter Review |
It would be very helpful for debugging (on platforms like OSX and somes UNIXs which have a hard time loading symbols for shared libraries in a debugger) if some sort of cross-platform TRACE or LOGGING were implemented in the mozilla plugins module like was done in imaging or networking. I think that by using this it will be easier to find the cause of bugs and prevent regressions. This kind of extra debug output could also be used in the future for automated regression tests. The following patch starts to implement NSPR logging for: * ns4xPlugin.cpp * ns4xPluginInstance.cpp * nsPluginHostImpl.cpp I'd like to get this chunk of patch in for now before moving on to more detail in these files and others. There are three kinds of logs, each having several levels: * General Plugin Logging * 4.x NPP API * 4.x NPN API Basic directions for use are included in nsPluginLogging.h While I was working on these files, I noticed a LARGE number of tabs. There were so many of them, (eek!) I couldn't stop myself from fixing as many as I could! By no means is this code cleanup complete, but it does make things a little bit more readable. To see diffs without whitespace changes, use cvs -w.
Assignee | ||
Comment 1•23 years ago
|
||
Assignee | ||
Updated•23 years ago
|
Assignee | ||
Comment 2•23 years ago
|
||
From MSVC Help: "A #define without a token-string removes occurrences of identifier from the source file. The identifier remains defined and can be tested using the #if defined and #ifdef directives." How about this: #ifdef PLUGIN_LOGGING #define NPN_PLUGIN_LOG(a, b) \ PR_BEGIN_MACRO \ PR_LOG(nsPluginLogging::gNPNLog, a, b); \ PR_LogFlush(); \ PR_END_MACRO #else #define NPN_PLUGIN_LOG(a, b) //!! nothing here #endif
Assignee | ||
Comment 5•23 years ago
|
||
I wanted more control and I didn't like the way NSPR defined them. I was thinking of later specifying a "network" or "event" log level than just noisy, normal, and basic.
Also, I would take bolder action and remove all printfs. I think, edburn's printfs were added for some local purposes and probably no longer needed. As well as my range request output.
Assignee | ||
Comment 8•23 years ago
|
||
Assignee | ||
Comment 9•23 years ago
|
||
The updated patch: * removes #debug_edburns printf()'s * adds more NOISY logging for streams * conflicts resolved Marc, can you super review?
Comment 10•23 years ago
|
||
What about my 2001-08-14 12:14 comment?
Assignee | ||
Comment 11•23 years ago
|
||
Ahh..sorry..new patch in just a bit....
Assignee | ||
Comment 12•23 years ago
|
||
Comment 13•23 years ago
|
||
Peter, can you attach a patch without the whitespace changes please? It will be much easier to review...
Assignee | ||
Comment 14•23 years ago
|
||
Assignee | ||
Comment 15•23 years ago
|
||
Comment 16•23 years ago
|
||
r=av on last modification of the patch.
Comment 17•23 years ago
|
||
* nsPluginLogging.h: note the line that says \ No newline at end of file you want to fix that. * There is an #if 0 you might want to remove in ns4xPlugin.cpp Looks like a very nice cleanup, and somce useful logging! So, assuming that you compiled with and without NSPR_LOGGING and PLUGIN_LOGGING defined, then sr=attinasi.
Comment 18•23 years ago
|
||
Looks good. r=edburns
Assignee | ||
Comment 19•23 years ago
|
||
Patch checked in, marking FIXED.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Updated•2 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•