1 package org.lsst.ccs.utilities.logging;
2
3 import org.lsst.ccs.utilities.tracers.Tracer;
4
5 import java.io.IOException;
6 import java.util.logging.FileHandler;
7 import java.util.logging.Level;
8 import java.util.logging.LogRecord;
9
10
11
12
13
14
15 public class FileHandlerN extends FileHandler {
16 public FileHandlerN() throws IOException, SecurityException {
17
18 }
19
20 public FileHandlerN(String pattern) throws IOException, SecurityException {
21 super(pattern);
22 }
23
24 public FileHandlerN(String pattern, boolean append) throws IOException, SecurityException {
25 super(pattern, append);
26 }
27
28 public FileHandlerN(String pattern, int limit, int count) throws IOException, SecurityException {
29 super(pattern, limit, count);
30 }
31
32 public FileHandlerN(String pattern, int limit, int count, boolean append) throws IOException, SecurityException {
33 super(pattern, limit, count, append);
34 }
35
36 protected IsLoggableDelegate isLoggableDelegate = new IsLoggableDelegate();
37
38
39
40
41 protected IsLoggableDelegate isLoggableDelegate2 = new IsLoggableDelegate();
42
43 @Override
44 public boolean isLoggable(LogRecord record) {
45 boolean res = super.isLoggable(record) ;
46 if(! res) {return false ;}
47 boolean delegateVal = isLoggableDelegate.isLoggable(record);
48 if(delegateVal) return true ;
49 assert Tracer.trace(record + " loggable ? " + res);
50 return isLoggableDelegate2.isLoggable(record);
51 }
52
53 private static final int offValue = Level.OFF.intValue();
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68 @Override
69 public void publish(LogRecord record) {
70 assert Tracer.trace("record to be written :" + record.getMessage());
71 super.publish(record);
72 }
73
74
75
76 }