Closed Bug 117440 Opened 24 years ago Closed 16 years ago

remove usages of DEBUG_PRINTF in favor of NS_ASSERTION/NS_WARNING

Categories

(Core :: General, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
mozilla1.9.3a2

People

(Reporter: Morten, Assigned: sgautherie)

References

()

Details

Attachments

(5 files, 8 obsolete files)

815 bytes, patch
darin.moz
: review+
Details | Diff | Splinter Review
11.66 KB, patch
brendan
: review+
brendan
: superreview+
Details | Diff | Splinter Review
1.63 KB, patch
brendan
: superreview+
Details | Diff | Splinter Review
950 bytes, patch
smontagu
: review+
Details | Diff | Splinter Review
1.30 KB, patch
jst
: review+
Details | Diff | Splinter Review
Timeless asked me to do this... not yet tested fully, but it doesn't break my optimized tree fwiw. will do a debug build as soon as I have freed up enough space. patch coming up in a minute...
Status: NEW → ASSIGNED
Attached patch first cut (obsolete) — Splinter Review
Keywords: patch
Keywords: review
Attached patch new, improved patch (obsolete) — Splinter Review
With space freed, I was able to build debug build, and make the patch work.
Attachment #63072 - Attachment is obsolete: true
Attachment #63126 - Attachment is obsolete: true
Attached patch missed one (obsolete) — Splinter Review
Attachment #63144 - Attachment is obsolete: true
Attached patch dropped a couple of values :( (obsolete) — Splinter Review
Attachment #63152 - Attachment is obsolete: true
Attachment #63153 - Flags: review+
NS_WARNING does not work like PR_LOG -- it does not take a parenthesized actual parameter list. It takes a single string argument. So changes such as this: + NS_WARNING(("\n\ncharset = %s", atomToName(charset))); do not have the effect you want -- they'll pass the final operand in a comma expression as the single string argument. /be
Attached patch Better patch, hopefully final? (obsolete) — Splinter Review
Attachment #63153 - Attachment is obsolete: true
I'd like jag to sr= the last patch. Do we really need to wrap nsPrintfCString in an nsCAutoString? Maybe the kLocalBufferSize in nsPrintfCString.h is too small; if it were bigger, we could just declare a local nsPrintfCString and pass it to NS_WARNING, and avoid another (bigger) stack-allocated string, and the copy into that auto-string's buffer. /be
I wrapped nsPrintfCString in nsCAutoString because otherwise it wouldn't compile... I got that piece of code from jag. IIRC, he said "use nsCAutoString(nsPrintfString(..)).get() for now" so I suppose there might be a better solution.
I advised wrapping the result of nsPrintfCString in a nsCAutoString so he could use .get(). With this patch one can call .get() on a nsPrintfCString directly.
Right, what Morten said (no conflicts when submitting comments from patch manager).
Comment on attachment 64080 [details] [diff] [review] Make nsPrintfCString inherit from nsAFlatCString [Checkin: Comment 42] sr=alecf
Attachment #64080 - Flags: superreview+
Attachment #63482 - Attachment is obsolete: true
Comment on attachment 64080 [details] [diff] [review] Make nsPrintfCString inherit from nsAFlatCString [Checkin: Comment 42] r/sr=darin
Attachment #64080 - Flags: review+
Comment on attachment 64085 [details] [diff] [review] remove nsCAutoString wrapping [Checkin: See comment 21=44] >@@ -136,7 +134,7 @@ > const char* registryLocation, \ > const nsModuleComponentInfo *info) \ > { \ >- UCONV_DEBUG_PRINTF("UnRegSelf " _From " to " _To "converter not implement\n"); \ >+ NS_WARNING("UnRegSelf " _From " to " _To "converter not implement\n"); \ > return NS_OK; \ > } "not implemented\n" for proper English -- and why isn't this returning NS_ERROR_NOT_IMPLEMENTED rather than NS_OK? Fix those two things and sr=brendan@mozilla.org. I recorded timeless's r=, which carries over. /be
Attachment #64085 - Flags: superreview+
Attachment #64085 - Flags: review+
this patch replaces part of attachment 64058 [details] [diff] [review], but not all of it. this patch also removes unneeded \'s from most of the lines...
bah... seems atleast some \'s where actually needed... investigating them
Attachment #64095 - Attachment is obsolete: true
Attachment #64096 - Attachment is obsolete: true
Comment on attachment 64097 [details] [diff] [review] final patch to nsICharsetConverterManager.h [Checkin: Comment 21=43] sr=brendan@mozilla.org
Attachment #64097 - Flags: superreview+
Attachments 64085/64097 checked in.
allrighty then
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
These used to be off by default and could be turned on if needed. Now these warnings are firing all the time in debug builds and there is no way to enable them in a non-debug build.
I'm curious why I was not included in the bug from the beginning.
or Shanjian or Roland since this is the area we work in every day.
One of the problems that the developers that work on font bugs face is that the font setup varies wildly from system. The font code tries a variety of thing to get the best fonts so its behavior is fairly complex. To debug problems a developer needs more info than just "it does not look good" consider bug 128338: Incorrect fonts used for certain "lang=" attributes > When setting NS_FONT_DEBUG=3 and loading the page in the URL > field I get the output below. ... > As far as I can tell from looking at the relevant standards > both "no", "no-bokmal" and "nb" should be correct identifiers > for the same language. > > > GetFontNames -adobe-courier-*-*-*-*-*-*-*-*-*-*-iso8859-1 > loaded -adobe-courier-medium-r-normal--12-120-75-75-m-70-iso8859-1 > FindFont(0061)[monospace, ] > returns -adobe-courier-medium-r-normal--12-120-75-75-m-70-iso8859-1 > GetFontNames -*-*-*-*-*-*-*-*-*-*-*-*-cns11643.1986-2 > GetFontNames -*-*-*-*-*-*-*-*-*-*-*-*-cns11643.1992.2-0 Without information about what fonts are being considered how would a developer tell what was happening? Withoug knowing the details of what is happening it is hard to fix bugs like this. Is the plan that to fix font bugs the developer will always need to make and post a debug build so the diagnostics will be available? Won't requiring custom build make the task of debugging much more difficult and far slower as well as possibly introduce compilcations from new bugs?
Yeah, I'm with Brian: this is a job for PR_LOG, forced on in release builds (and used sparingly in performance-critical paths!).
Since this patch broke the existing working code (it now reports when it is not wanted and cannot report when it is needed) can those who put this patch in at least fix those parts and explaing how their fix will be used/controlled?
I am distressed by the lack of comment or "commitment to make working code" by those who put in this patch. Nobody's mother works here. We all need to clean up after ourselves. I am also still waiting to hear comment on why the people that regularily work in this code were not contacted before this patch was put in. Perhaps we should just back out this work.
bstell, sorry for not ensuring you got to r= -- this looked like pan-module cleanup, and I blew it. We've had problems with mailnews guys not being apprised of pan-module cleanups touching their code, and not having a crack at r= -- this has led to super-review angst, admonishment, and advice for a better tomorrow -- tree-wide patches should be broken up by module, so that each module owner or peer can r= using the patch manager. Sorry again, do what you need to do to fix it right. PR_LOG forced on sounds good to me too. /be
Brendan: Thank you for responding. I am glad to see some discussion of the basic communication issue. I do not feel any need to r= everything that gets done in this area. I am in fact glad to see other working on trying to improve it. No one of us can do it all. My concern is that by failing to include those that work in an area it is all too easy to misunderstand what the code is doing. Without knowing what the code is doing it is very hard not to break it even if unintentionally. With a very little bit of input at an early stage this would probably be working code instead of broken code. I am not especially concerned with the exact implementation of this code but the feature it provides is there to help with maintenance and it weakens the product to lose it. I am very open to an alternate implementations that provide similar maintenance utility. I am, however, very sensitive to having clean up code broken by others as this was a major problem for the i18n department in the NS4x days. We worked very hard to get out of this mode. Last time I left Netscape this was a major reason.
At this point I would like to hear the people who made the change step forward and discuss how they will rectify this situation.
I'm sorry if my patcch here stepped on anybody's toes, but I did it because timeless wanted me to... I'm quite new to mozilla hacking, and timeless gave me this little task as a nice easy thing to do... If the consent is that this patch ruins the day, it's fine by me if it's backed out, or at least two of the patches... the third one should stay in (attachment 64080 [details] [diff] [review])
Morten: I'm not especially concerned that you might have stepped on my toes. Its no problem. In team activities everyone ends up stepping on others toes every now and then. I certianly have stepped on others toes. I am okay with someone going forward to make this work using PR_LOG. I am okay with someone backing out the code (less the indicated bit) to make it work like it used to. How can we get to the point of working code (and "All's well that ends well")?
Morten: are you going to fix this?
Sorry if I didn't make clear on this, but I'm all out of time to do anything mozilla-wise... Somebody else would need to do this. Sorry.
bstell: I can take this one... I only need a description what I should fix... :)
Roland: Do to a misunderstanding of their purpose some of the NS_FONT_DEBUG statements were converted to assertions. This means that for debug builds they report when they should not and for optimized builds they cannot report when we want to find out what the font subsystem is doing on a user's system. One possible solution would be to simply backout the changes. Another possible solution would be to use PR_LOG. Of course we would still want to have the messages not report during debug and be able to be turned on in a user's sytem.
reassigning bug to Roland since he has expressed a wish to take this.
Assignee: Morten → Roland.Mainz
Status: REOPENED → NEW
I'm looking over my old bugs (still not able to work on this myself) should this bug be closed or reassigned to nobody@mozilla.org?
Product: Browser → Seamonkey
(In reply to comment #34) > ... > I am okay with someone going forward to make this work using PR_LOG. > > I am okay with someone backing out the code (less the indicated bit) to make > it work like it used to. I don't see a comment, but it does appear this was backed out. Please comment if I am incorrect.
Assignee: roland.mainz → nobody
QA Contact: granrosebugs → build-config
Attachment #64080 - Attachment description: Make nsPrintfCString inherit from nsAFlatCString → Make nsPrintfCString inherit from nsAFlatCString [Checkin: Comment 42]
Attachment #64097 - Attachment description: final patch to nsICharsetConverterManager.h → final patch to nsICharsetConverterManager.h [Checkin: Comment 21=43]
Attachment #64085 - Attachment description: remove nsCAutoString wrapping → remove nsCAutoString wrapping [Checkin: See comment 21=44]
(In reply to comment #41) > I don't see a comment, but it does appear this was backed out. Please comment > if I am incorrect. No backout. Yet the files affected by the 2 patches which "should have been" were all removed since. Thus if any of this code was moved to some other/new files, then too bad.
Severity: normal → minor
Component: Build Config → General
Flags: in-testsuite-
Product: SeaMonkey → Core
QA Contact: build-config → general
Target Milestone: --- → mozilla1.9.2a1
Assignee: nobody → sgautherie.bz
Status: NEW → ASSIGNED
Attachment #374003 - Flags: review?(smontagu)
Attachment #374003 - Flags: review?(smontagu) → review+
Comment on attachment 374003 [details] [diff] [review] (Dv1) <nsCompressedCharMap.cpp> remove commented out FONT_SCAN_PRINTF() [Checkin: Comment 47] http://hg.mozilla.org/mozilla-central/rev/e883a4efa220
Attachment #374003 - Attachment description: (Dv1) <nsCompressedCharMap.cpp> remove commented out FONT_SCAN_PRINTF() → (Dv1) <nsCompressedCharMap.cpp> remove commented out FONT_SCAN_PRINTF() [Checkin: Comment 47]
Depends on: 489728
Comment on attachment 374212 [details] [diff] [review] (Ev1) <xpcwrappednativescope.cpp> remove unused |#ifdef + NS_WARNING()| case [Checkin: Comment 50] Looking for any review(er)...
Attachment #374212 - Flags: superreview?(jst) → review?(shaver)
Attachment #374212 - Flags: review?(shaver)
Attachment #374212 - Flags: review?(jst)
Attachment #374212 - Flags: review+
Comment on attachment 374212 [details] [diff] [review] (Ev1) <xpcwrappednativescope.cpp> remove unused |#ifdef + NS_WARNING()| case [Checkin: Comment 50] http://hg.mozilla.org/mozilla-central/rev/65f84c853781
Attachment #374212 - Attachment description: (Ev1) <xpcwrappednativescope.cpp> remove unused |#ifdef + NS_WARNING()| case → (Ev1) <xpcwrappednativescope.cpp> remove unused |#ifdef + NS_WARNING()| case [Checkin: Comment 50]
Attachment #374212 - Flags: review+
Status: ASSIGNED → RESOLVED
Closed: 24 years ago16 years ago
Resolution: --- → FIXED
Target Milestone: mozilla1.9.2a1 → mozilla1.9.3a2
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: