|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.openrdf.util.log.ThreadLog
Thread-based logging utility. The ThreadLog requires threads to register themselves with the ThreadLog. In this registration procedure, a mapping is made between the thread calling the registration method and an instance of ThreadLog. This mapping is later used in all calls to logging-methods to look-up whether these messages should be logged, and where they should be logged.
Log messages are assigned a "level of importance". From high to low, these levels are ERROR, WARNING, STATUS and TRACE. Messages can be suppressed based on these levels. If a Thread registers itself with log level WARNING, only errors and warning will be logged; status messages and traces will be suppressed.
| Field Summary | |
static int |
ALL
|
static int |
ERROR
|
static int |
NONE
|
static int |
STATUS
|
static int |
TRACE
|
static int |
WARNING
|
| Method Summary | |
static void |
deregisterThread()
Deregisters the calling thread with the ThreadLog. |
static void |
error(String msg)
Logs an error. |
static void |
error(String msg,
Object arg)
Logs an error. |
static void |
log(String msg)
Logs a message. |
static void |
log(String msg,
Object arg)
Logs a message. |
static void |
registerThread(String logFile,
int logLevel)
Registers the calling thread with the ThreadLog. |
static void |
setDefaultLog(String logFile,
int logLevel)
Sets a default log file for all threads that have not registered themselves. |
static void |
setLogLevel(int logLevel)
Changes the log level for the calling thread. |
static void |
trace(String msg)
Logs a trace message. |
static void |
trace(String msg,
Object arg)
Logs a trace message. |
static void |
unsetDefaultLog()
Unsets the default log file for all threads that have not registered themselves. |
static void |
warning(String msg)
Logs a warning. |
static void |
warning(String msg,
Object arg)
Logs a warning. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int NONE
public static final int ERROR
public static final int WARNING
public static final int STATUS
public static final int TRACE
public static final int ALL
| Method Detail |
public static void setDefaultLog(String logFile,
int logLevel)
logFile - The file to log to, or null to log messages
to System.err.logLevel - One of the constants ERROR, WARNING, STATUS, TRACE, or ALL.ERROR,
WARNING,
STATUS,
TRACE,
ALLpublic static void unsetDefaultLog()
public static void registerThread(String logFile,
int logLevel)
logFile - The file to log to, or null to log messages
to System.err.logLevel - One of the constants ERROR, WARNING, STATUS, TRACE, or ALL.ERROR,
WARNING,
STATUS,
TRACE,
ALLpublic static void setLogLevel(int logLevel)
logLevel - One of the constants ERROR, WARNING, STATUS, TRACE, or ALL.ERROR,
WARNING,
STATUS,
TRACEpublic static void deregisterThread()
public static void error(String msg)
msg - A indicative message for the error.
public static void error(String msg,
Object arg)
msg - A indicative message for the error.arg - An argument related to the error. In case arg is an
instance of java.lang.Throwable, the message and stack trace
of the argument will be logged.public static void warning(String msg)
msg - A indicative message for the warning.
public static void warning(String msg,
Object arg)
msg - A indicative message for the warning.arg - An argument related to the warning. In case arg is an
instance of java.lang.Throwable, the message and stack trace
of the argument will be logged.public static void log(String msg)
msg - A indicative message for the message.
public static void log(String msg,
Object arg)
msg - A indicative message for the message.arg - An argument related to the message. In case arg is an
instance of java.lang.Throwable, the message and stack trace
of the argument will be logged.public static void trace(String msg)
msg - A indicative message for the trace message.
public static void trace(String msg,
Object arg)
msg - A indicative message for the trace message.arg - An argument related to the trace message. In case arg is an
instance of java.lang.Throwable, the message and stack trace
of the argument will be logged.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||