public class LogHandler extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static PrintWriter |
defaultSink |
protected int |
level |
protected PrintWriter |
sink |
| Constructor and Description |
|---|
LogHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the log.
|
void |
flush()
Flush the log.
|
int |
getLevel()
Get the current verbosity level.
|
void |
log(String prefix,
String msg,
Throwable t,
int verbosityLevel)
Prints log message and stack trace.
|
static void |
setDefaultSink(Writer w)
Set the default output stream that is used by all logging
channels.
|
void |
setLevel(int level)
Set the verbosity level for this logger.
|
protected PrintWriter sink
protected int level
protected static PrintWriter defaultSink
public void log(String prefix, String msg, Throwable t, int verbosityLevel)
prefix - optional prefix.message - the message to log.t - the exception that was thrown.verbosityLevel - what type of message is this?
(WARNING/DEBUG/INFO etc)public void flush()
public void close()
public void setLevel(int level)
level - one of the verbosity level codes.public int getLevel()
public static void setDefaultSink(Writer w)
w - the default output stream.Copyright © 2005–2017 Oracle Corporation. All rights reserved.