This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 24056 - ErrorManager's treatment of notify doesn't honor isLoggable
Summary: ErrorManager's treatment of notify doesn't honor isLoggable
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: All All
: P4 blocker (vote)
Assignee: Jesse Glick
Depends on: 28990
Blocks: 28240
  Show dependency tree
Reported: 2002-05-25 01:20 UTC by Rochelle Raccah
Modified: 2008-12-22 21:42 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description Rochelle Raccah 2002-05-25 01:20:14 UTC
From a discussion with Jesse on nbdev:
> > Why doesn't NbErrorManager's implementation of 
> > notify(severity,throwable) check isLoggable? 
I find a 
> > discrepancy here - my logs which
> > include an exception are logged, but my others
are not.
> I guess it's a discrepancy, but generally you
> exceptions to be logged to the log file because
they might be used to
> debug something - generally when an exception is
thrown, something
> messed up - whereas INFORMATIONAL log messages
are as a rule just noise
> if you are not specifically looking for them. So
it is practical the way
> it is, though not consistent.

I agree that INFORMATIONAL exceptions could be
useful, but if the error manager was configured
such that the minimum level is ERROR, let's say,
then I don't think the log should contain any
INFORMATIONAL logs whether they originated from a
log or notify call.  For example, many panels
throw UserCancelException when the user presses
cancel.  I might want to log this, but clearly
nothing is wrong....  So I think notify should
also check isLoggable.  Should I file an issue?

Jesse's response:
>>I guess so, although I don't know what the
solution should be, because
>>the current behavior is in fact the desired
behavior in situations we
>>have come across, and it needs to be supported
somehow (and be the default).
> So, should I file something or not?

File an issue, but I don't know how it will be
Comment 1 _ ttran 2002-06-04 14:22:29 UTC
-> jglick
Comment 2 Marek Grummich 2002-07-22 08:44:13 UTC
Target milestone was changed from '3.4' to TBD.
Comment 3 Marek Grummich 2002-07-22 08:48:38 UTC
Target milestone was changed from '3.4' to TBD.
Comment 4 Marek Grummich 2002-07-22 08:52:13 UTC
Target milestone was changed from '3.4' to TBD.
Comment 5 Marek Grummich 2002-07-22 09:23:18 UTC
Target milestone was changed from '3.4' to TBD.
Comment 6 Jesse Glick 2002-11-03 16:15:03 UTC
Fixed, more or less. Now exceptions are notified if applicable, but
their effective level is considered one more than those of messages.
Note: this means +1, not "the next documented level"; numeric values
of ErrorManager levels are (for some godawful reason) 0, 1, 16, 256,
... So e.g. to suppress warning messages, use a level of 17, but to
suppress warning stack traces too, use 18.

Making the level identical for messages and exceptions would be more
logical, and if we could do everything over from the start I would do
it this way, but at this point it is not feasible. Dozens of classes
notify exceptions at INFORMATIONAL when they mean "something maybe
wrong, print a stack trace to assist in debugging, maybe alert active
developers" and log messages at INFORMATIONAL to mean "debugging code,
turn on to see how everything works". These usages are not compatible
with one another. Trying to force exception and log levels to match
would have required dozens of patches to the NB source base and been a
de-facto incompatibility for other modules. So the workaround seems

Added isNotifiable(int) to be able to check the result.

committed   * Up-To-Date  1.45       
committed   * Up-To-Date  1.81        openide/
committed   * Up-To-Date  1.108      
committed   * Up-To-Date  1.20       
Comment 7 Rochelle Raccah 2003-07-11 21:46:28 UTC
Works now.