|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.objectweb.jac.util.Log
The Log
class provides a means to send some
informational, debugging or error messages like
System.out.println
but traces can be enabled or
disabled at runtime.
JAC supports a -V launching option that allows the user to
enable a given trace category (for instance, by using -V
jac
, the user can see what happens in the JAC core system.
Constructor Summary | |
Log()
|
Method Summary | |
static String |
dump()
|
static void |
error(String message)
Traces an error into the System.err stream. |
static Set |
getCategories(Object substance)
|
static Map |
getLevels()
Returns a Map category -> enabled saying which traces are enables |
static void |
setFileName(String name,
String header)
Sets the logging file. |
static void |
setLevel(String category,
int level)
Sets the verbose level of a given category. |
static void |
stack(String category)
|
static void |
stack(String category,
int level)
Prints a stack trace. |
static void |
trace(String category,
int level,
String message)
Traces with a level lower than levels[category] are
discarded. |
static void |
trace(String category,
int level,
Throwable exception)
Print the stack trace of an exception with a level lower than levels[category] are discarded. |
static void |
trace(String category,
String message)
Traces with a level equals to 1. |
static void |
trace(String category,
Throwable exception)
Print a stack trace with a level equals to 1. |
static void |
warning(String message)
Traces a warning into the System.err stream. |
static void |
warning(String message,
int level)
Traces a warning into the System.err stream. |
static void |
warning(String category,
int level,
String message)
Traces a warning into the System.err stream only if
the given category is enable to trace. |
static void |
warning(String category,
String message)
Traces a warning into the System.err stream only if
the given category is enable to trace. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Log()
Method Detail |
public static void setFileName(String name, String header)
name
- the file name if null=>log to the standard outputheader
- a string to prepend to each line logged.public static void trace(String category, int level, String message)
levels[category]
are
discarded.
category
- a string representing the category to tracelevel
- the level of the trace (1 is always printed)message
- the message to print outpublic static void trace(String category, int level, Throwable exception)
levels[category]
are discarded.
category
- a string representing the category to tracelevel
- the level of the trace (1 is always printed)exception
- the exceptionpublic static void stack(String category, int level)
category
- a string representing the category to tracelevel
- the level of the trace (1 is always printed)public static void stack(String category)
public static void trace(String category, String message)
category
- a string representing the category to tracemessage
- the message to print outtrace(String,int,String)
public static void trace(String category, Throwable exception)
category
- a string representing the category to traceexception
- the message to print outtrace(String,int,String)
public static void error(String message)
System.err
stream.
message
- the error message to print outpublic static void warning(String message, int level)
System.err
stream.
message
- the warning message to print outlevel
- warning level (0=important, 1=normal, 2=low, ...)public static void warning(String message)
System.err
stream.
message
- the warning message to print outpublic static void warning(String category, String message)
System.err
stream only if
the given category is enable to trace.
message
- the warning message to print outpublic static void warning(String category, int level, String message)
System.err
stream only if
the given category is enable to trace.
message
- the warning message to print outpublic static void setLevel(String category, int level)
The higher, the more traces are printed out.
category
- the category to set the level oflevel
- the category verbose levelpublic static Map getLevels()
public static Set getCategories(Object substance)
public static String dump()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |