|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--anthill.util.Log
This class contains a set of static methods for the management of log files. The log information can be printed on both the standard output and a log file, whose name is generated using the name of the host in which the log class is running and the current time. Different log level may be associated to both the standard output and the log file, in order to obtain different set of information.
Field Summary | |
static boolean |
DEBUG
True if the log function is active. |
Constructor Summary | |
Log()
|
Method Summary | |
static void |
flush()
|
static void |
print(int level,
Object obj)
If the log is not active, print an exception on the standard output. |
static void |
print(Object obj)
Prints the specified information on the standard output. |
static void |
printFile(int level,
Object object)
If the log is not active, print an exception on the standard output. |
static void |
printFile(Object object)
Prints the specified information on the standard output. |
static void |
println(int level,
Object obj)
If the log is not active, print an exception on the standard output. |
static void |
println(Object obj)
Prints the specified information on the standard output and terminates the line. |
static void |
printlnFile(int level,
Object object)
If the log is not active, print an exception on the standard output. |
static void |
printlnFile(Object object)
Prints the specified information on the standard output and terminates the line. |
static void |
printStackTrace(Exception e)
Print the stack trace of the specified exception on the standard output; if the log function is active, print the stack trace on the log file as well. |
static void |
printStackTrace(int level,
Exception e)
If the log is not active, prints an exception on the standard output. |
static void |
setFileLevel(int level)
Set the file debug level to |
static void |
setOutLevel(int level)
Set the console log level to |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final boolean DEBUG
Constructor Detail |
public Log()
Method Detail |
public static void setFileLevel(int level)
level
- the new logging level.public static void setOutLevel(int level)
level
- the new logging level.public static void printFile(Object object)
public static void print(Object obj)
obj
- the object to be printed.public static void printlnFile(Object object)
public static void println(Object obj)
obj
- the object to be printed.public static void printFile(int level, Object object)
level
- the log level of this informationpublic static void print(int level, Object obj)
level
- the log level of this informationobj
- the object to be printed.public static void printlnFile(int level, Object object)
level
- the log level of this informationpublic static void println(int level, Object obj)
level
- the log level of this informationobj
- the object to be printed.public static void printStackTrace(Exception e)
e
- the exception to be printed.public static void flush()
public static void printStackTrace(int level, Exception e)
e
- the exception to be printed.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |