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

Summary: Logger does not honor severity
Product: java Reporter: _ briansmith <briansmith>
Component: UnsupportedAssignee: issues@java <issues>
Status: VERIFIED FIXED    
Severity: blocker    
Priority: P2    
Version: 3.x   
Hardware: PC   
OS: Windows ME/2000   
Issue Type: DEFECT Exception Reporter:
Attachments: Patch to Logger

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