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.
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 want INFORMATIONAL > 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 solved.
-> jglick
Target milestone was changed from '3.4' to TBD.
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 easiest. Added isNotifiable(int) to be able to check the result. committed * Up-To-Date 1.45 core/src/org/netbeans/core/NbErrorManager.java committed * Up-To-Date 1.81 openide/openide-spec-vers.properties committed * Up-To-Date 1.108 openide/api/doc/changes/apichanges.xml committed * Up-To-Date 1.20 openide/src/org/openide/ErrorManager.java
Works now.