|
JCas v0.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.OutputStream cas.util.Logger
Implements logging functionality. The messages are displayed on standard output by default. Additionally, they can be replicated to a logfile.
Field Summary | |
protected static Date |
currentTime
|
static int |
ERROR
|
protected static SimpleDateFormat |
formatter
|
static int |
INFO
|
protected static File |
logfile
|
protected static int |
loglevel
|
protected static cas.util.Logger.MyPrintWriter |
logwriter
|
static int |
TRACE
|
Constructor Summary | |
Logger()
|
Method Summary | |
static void |
closeLog()
Closes the log. |
protected static void |
closeWriter(cas.util.Logger.MyPrintWriter writer)
Closes the log stream if it is not the standard out or default logfile. |
static void |
debug(String label,
Object o)
Prints debugging information. |
protected static String |
getDate()
Returns the formatted, current date and time. |
static int |
getLogLevel()
Returns the log level. |
protected static cas.util.Logger.MyPrintWriter |
getWriter(File f)
Returns the correct writer. |
static void |
log(Object o)
Logs an object with its toString() method. |
static void |
log(Object src,
String s)
Logs the string marked wih the specified object as the message source. |
static void |
log(Object src,
String s,
int level,
File logfile)
Logs the message issued by the source with the specified log level. |
static void |
log(String s)
Logs a message. |
static void |
log(String s,
File logfile)
Logs a message to a specific file. |
static void |
log(String s,
int level)
Logs a message with the specified log level. |
static void |
log(String s,
int level,
File logfile)
Logs a message with the specified log level to a specific file. |
static void |
log(Throwable e)
Logs the exception. |
static void |
log(Throwable e,
File logfile)
Logs the exception to a specific logfile. |
static void |
log(Throwable e,
int level,
File logfile)
Logs the exception with the specified log level. |
static void |
logArray(Object[] o)
Logs the string array. |
static void |
setLogfile(File f)
Sets the logfile. |
static void |
setLogfile(String s)
Sets the logfile. |
static void |
setLogLevel(int l)
Sets the loglevel. |
void |
write(int b)
Implementation of the OutputStream methods. |
Methods inherited from class java.io.OutputStream |
close, flush, write, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ERROR
public static final int INFO
public static final int TRACE
protected static File logfile
protected static int loglevel
protected static cas.util.Logger.MyPrintWriter logwriter
protected static Date currentTime
protected static SimpleDateFormat formatter
Constructor Detail |
public Logger()
Method Detail |
public static void setLogfile(String s)
s
- the filename (can be null)public static void setLogfile(File f)
f
- the file (can be null)public static void setLogLevel(int l)
l
- loglevel between 0 and 2 (including).public static int getLogLevel()
public static void log(Object src, String s)
public static void log(Object o)
public static void log(String s)
public static void log(String s, File logfile)
public static void log(String s, int level)
public static void log(String s, int level, File logfile)
protected static cas.util.Logger.MyPrintWriter getWriter(File f)
protected static void closeWriter(cas.util.Logger.MyPrintWriter writer)
public static void log(Object src, String s, int level, File logfile)
public static void log(Throwable e)
public static void log(Throwable e, File logfile)
public static void log(Throwable e, int level, File logfile)
public static void debug(String label, Object o)
label
- a string to displayo
- the object to be printedpublic static void closeLog()
protected static String getDate()
public void write(int b) throws IOException
IOException
public static void logArray(Object[] o)
|
JCas v0.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |