Methods Summary |
---|
public synchronized void | close()Close the log.
this.sink = null;
|
public void | flush()Flush the log.
if( sink!=null)
sink.flush();
|
public int | getLevel()Get the current verbosity level.
return this.level;
|
public void | log(java.lang.String prefix, java.lang.String msg, java.lang.Throwable t, int verbosityLevel)Prints log message and stack trace.
This method should be overriden by real logger implementations
if( sink==null ) return;
// default implementation ( in case no real logging is set up )
if( verbosityLevel > this.level ) return;
if (prefix != null)
sink.println(prefix + ": " + msg );
else
sink.println( msg );
if( t!=null )
t.printStackTrace( sink );
|
public static void | setDefaultSink(java.io.Writer w)Set the default output stream that is used by all logging
channels.
if( w instanceof PrintWriter )
defaultSink=(PrintWriter)w;
else
defaultSink = new PrintWriter(w);
|
public void | setLevel(int level)Set the verbosity level for this logger. This controls how the
logs will be filtered.
this.level = level;
|