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 29167 - Logger does not honor severity
Summary: Logger does not honor severity
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P2 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-29 07:52 UTC by _ briansmith
Modified: 2005-07-27 09:04 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Patch to Logger (1.03 KB, patch)
2002-11-29 07:53 UTC, _ briansmith
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description _ briansmith 2002-11-29 07:52:54 UTC
1. The inherited implementation of isLoggable()
always returns true. Logger should override this
to honor the minimum severity.

2. The notify() method does not check the severity.

I will attach a patch that seems to fix (1) and
(2). I noticed in NbErrorManager that there was
this implementation of isNotifiable:
    /** Honor configured min-severity levels, more
or less.
     * Actually bump up the effective severity of an 
     * exception by one.
     * Thus by default INFORMATIONAL stack traces are 
     * displayed, but not messages. By playing with
     * min log severity levels, you can get
     * both, or neither.
     * @see #24056
     */
    public boolean isNotifiable(int severity) {
        return isLoggable(severity + 1);
    }

I don't know if this is the desired behavior for
the MDR Logger or not. 

Sorry I didn't notice this earlier; my code was
previously using
setProperty("org.netbeans.lib.jmi.Logger.fileName",
"") to prevent messages from being displayed
altogether, so I wasn't affected by this problem
until I switched to more fine-grained message
reporting.
Comment 1 _ briansmith 2002-11-29 07:53:23 UTC
Created attachment 8105 [details]
Patch to Logger
Comment 2 Martin Matula 2002-12-02 16:30:15 UTC
Brian, thanks for the fix. I have integrated it. I have 
also added the isNotifiable method implementation as 
isNotifiable was added to ErrorManager only recently (it 
is not present in NetBeans 3.4) - this way the same fix 
works also with NetBeans 3.4.
Martin
Comment 3 Jiri Prox 2005-07-27 09:04:03 UTC
quiet for too long, verified