Closed Bug 666376 Opened 13 years ago Closed 13 years ago

NSPR logging should allow to append log info to the log file

Categories

(NSPR :: NSPR, enhancement, P1)

enhancement

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: whimboo, Assigned: jduell.mcbugs)

Details

(Keywords: dev-doc-needed)

Attachments

(1 file, 2 obsolete files)

As discussed on bug 666022 comment 22 it would be helpful to have the capability of NSPR to append log data and not recreate the log file each time Firefox starts.

As Jason mentioned there is a patch available which was used to track another fix. So it should be minimal work to get in this enhancement.

https://bugzilla.mozilla.org/page.cgi?id=splinter.html&bug=534764&attachment=485332
Assignee: wtc → jduell.mcbugs
Here's a modified version of Srirang's patch (attachment 485332 [details] [diff] [review] from bug 534764).  I've changed the module name from "notrunc" to "append", because I think that's more intuitive, and made a few whitespace formatting changes.
Attachment #541309 - Flags: review?(wtc)
oops--got the boolean values reversed.  Silly me for not testing before I uploaded the patch.
Attachment #541309 - Attachment is obsolete: true
Attachment #541310 - Flags: review?(wtc)
Attachment #541309 - Flags: review?(wtc)
Can we get any progress on this bug? It's something I really would like to see so we could debug our software update failures on the day of a Firefox release.
WTC,

FYI you already reviewed the basic logic for this patch in bug 534764, so I doubt it'll take more than a glance-over to +r this.
jduell: I will try to review this patch this weekend or
next week.
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → 4.9
I changed the |mode| argument for fopen() from "a+"
to "a" because the '+' sign means "update" (reading
and writing).

jduell, please test this change on Windows.

Patch checked in on the NSPR trunk (NSPR 4.9).

Checking in prlog.c;
/cvsroot/mozilla/nsprpub/pr/src/io/prlog.c,v  <--  prlog.c
new revision: 3.54; previous revision: 3.53
done
Attachment #541310 - Attachment is obsolete: true
Attachment #541310 - Flags: review?(wtc)
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
When will this feature be available in Nightly builds of Firefox? Immediately or does it need a pull first? Also we should update the documentation on MDC.
Keywords: dev-doc-needed
Milestone is listed as "4.9" which leaves me really confused about how that correlates to Firefox. :)
The code is in m-c now, so this is in the nightly builds, and targeted for firefox 9.

I've verified that it works on windows and Linux.
Status: RESOLVED → VERIFIED
Works also fine on OS X with Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0a1) Gecko/20110919 Firefox/9.0a1. Thanks a lot!
Turns out the logging features in NSPR aren't yet documented at all, so this is going to serve as a placeholder bug for "document NSPR logging." Don't suppose anyone wants to do that?
This change is mentioned on Firefox 9 for developers; actual documentation needs to be written and is covered in bug 712002.
Eric, not sure where this feature has been documented, but we can't find it on MDN. Can you please re-check for the ',append' flag?
It's not even documented in the prlog.h file. (nor is ",timestamp" FWIW).  But the code is there.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: