01: package dalma.container;
02:
03: import java.util.logging.Logger;
04: import java.util.logging.Filter;
05: import java.util.logging.LogRecord;
06:
07: /**
08: * @author Kohsuke Kawaguchi
09: */
10: class LogUtil {
11: /**
12: * This {@link Logger} works like /dev/null, and thus suitable
13: * to be used as a parent logger when logs shouldn't show up
14: * in the system log.
15: */
16: /*package*/static final Logger NULL_LOGGER = Logger
17: .getAnonymousLogger();
18:
19: static {
20: NULL_LOGGER.setFilter(new Filter() {
21: public boolean isLoggable(LogRecord record) {
22: return false;
23: }
24: });
25: }
26:
27: static Logger newAnonymousLogger(Logger parent) {
28: Logger l = Logger.getAnonymousLogger();
29: l.setParent(parent);
30: return l;
31: }
32: }
|