|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--attrib4j.Log
Simple helper class that allows to send debug messages to the Java console according to the tracing level. Log levels are from standard unix syslog. TODO Switch to levels used in log4j or jdk1.4
Field Summary | |
static int |
ALERT
A condition that should be corrected immediately. |
static int |
CRITICAL
Critical conditions. |
static int |
DEBUG
Message that contain information normally of use only when debugging a program. |
static int |
EMERGENCY
A panic condition. |
static int |
ERROR
Errors. |
static int |
INFO
Informational messages. |
static int |
LEVEL
Debug level Note: It has been made public for performance optimization to reduce overhead of including tracing messages |
static int |
NOTICE
Conditions that are not error conditions, but that may require special handling. |
static int |
WARNING
Warning messages |
Constructor Summary | |
Log()
|
Method Summary | |
static void |
debug(java.lang.Object o,
java.lang.String message)
Convenience method to pick the debug level using the method name. |
static void |
debug(java.lang.String message)
Convenience method to pick the debug level using method name. |
static void |
error(java.lang.Object o,
java.lang.String message)
Convenience method to pick the error level using the method nam.e |
static int |
getLevel()
Return the log level. |
static void |
info(java.lang.Object o,
java.lang.String message)
Convenience method to pick the debug level using the method name. |
static void |
info(java.lang.String message)
Convenience method to pick the debug level using method name. |
static void |
log(java.lang.String message)
Quick log method signature. |
static void |
log(java.lang.String message,
int level)
A log message with a given level. |
static void |
log(java.lang.String message,
int level,
java.lang.Object object)
A log message with a level and the class that called this method. |
static void |
setLevel(int level)
Set the log level for future invocations. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static int DEBUG
public static int INFO
public static int NOTICE
public static int WARNING
public static int ERROR
public static int CRITICAL
public static int ALERT
public static int EMERGENCY
public static int LEVEL
Constructor Detail |
public Log()
Method Detail |
public static void log(java.lang.String message)
message
- a value of type 'String'public static void log(java.lang.String message, int level)
public static void log(java.lang.String message, int level, java.lang.Object object)
message
- Log Messagelevel
- Log levelobject
- Callers class.public static void debug(java.lang.Object o, java.lang.String message)
o
- The callers class.message
- Log mesasge.public static void error(java.lang.Object o, java.lang.String message)
o
- The callers classmessage
- Log Messagepublic static void info(java.lang.String message)
message
- a value of type 'String'public static void info(java.lang.Object o, java.lang.String message)
o
- The callers class.message
- Log mesasge.public static void debug(java.lang.String message)
message
- a value of type 'String'public static void setLevel(int level)
level
- a value of type 'int'public static int getLevel()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |