|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCTL.Logger
public class Logger
Filter-based logging class
Field Summary | |
---|---|
static int |
ALL
All information |
static int |
DBG
Debugging information, level 0 |
static int |
DBG1
Debugging information, level 1 |
static int |
DBG2
Debugging information, level 2 |
static int |
ERR
Error |
private java.io.FileWriter |
file
The file to write to |
static int |
INFO
Information |
private static int |
loglevel
Filter level of this Logger (default: anything equally or more important than warning) |
static int |
WARN
Warning |
Constructor Summary | |
---|---|
private |
Logger(java.lang.String fname)
Generate a new Logger with default filter |
|
Logger(java.lang.String fname,
int loglevel)
Generate a new Logger with user-defined filter treshold |
Method Summary | |
---|---|
void |
close()
Close the underlying file |
private static java.lang.String |
gettimeofday(boolean foo)
Determine current time |
static void |
main(java.lang.String[] args)
|
void |
msg(int lvl,
java.lang.String msg)
Write a message to the logfile |
void |
msg(java.lang.String msg)
Write a message to the logfile |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ERR
public static final int WARN
public static final int INFO
public static final int DBG
public static final int DBG1
public static final int DBG2
public static final int ALL
private java.io.FileWriter file
private static int loglevel
Constructor Detail |
---|
private Logger(java.lang.String fname)
fname
- Logfilepublic Logger(java.lang.String fname, int loglevel)
fname
- Logfileloglevel
- Filter tresholdMethod Detail |
---|
public void close()
public void msg(int lvl, java.lang.String msg)
lvl
- Importance of this message, if equally or more important
than the filter treshold, it will be loggedmsg
- Log messagepublic void msg(java.lang.String msg)
msg
- Log messageprivate static java.lang.String gettimeofday(boolean foo)
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |