|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.core.node.NodeLogger
public final class NodeLogger
The general logger used to write info, warnings, errors , debugging, assert
messages, exceptions, and coding problems into the internal Log4J logger. The
loggers are configured by the log4j.properties
file in the
root of the core package. The configuration can be overridden by specifying a
file in -Dlog4j.configuration
(this is the standard log4j
behaviour). Furthermore, it is possible to add and remove additional writers
to this logger. Note, calling setLevelIntern(LEVEL)
does only effect
the minimum logging level of the default loggers. All other writers' levels
have to be set before hand.
Nested Class Summary | |
---|---|
static class |
NodeLogger.LEVEL
The logging levels. |
Field Summary | |
---|---|
static String |
LOG_FILE
The default log file name, knime.log. |
Method Summary | |
---|---|
static void |
addWriter(Writer writer,
NodeLogger.LEVEL minLevel,
NodeLogger.LEVEL maxLevel)
Adds a new Writer with the given level to this logger. |
void |
assertLog(boolean b,
String m)
Check assert and write into logger if failed. |
void |
assertLog(boolean b,
String m,
AssertionError e)
Check assertions on/off and write debug message into logger. |
void |
coding(Object o)
Writes CODING PROBLEM plus this message into this logger as error. |
void |
coding(Object o,
Throwable t)
Writes CODING PROBLEM plus this message, as well as the the message of the throwable into this logger as error and debug. |
void |
debug(Object o)
Write debugging message into this logger. |
void |
debug(Object o,
Throwable t)
Write debugging message and throwable into this logger. |
void |
error(Object o)
Write error message into the logger. |
void |
error(Object o,
Throwable t)
Write error message and throwable into the logger. |
void |
fatal(Object o)
Write fatal error message into the logger. |
void |
fatal(Object o,
Throwable t)
Write fatal error message and throwable into the logger. |
NodeLogger.LEVEL |
getLevel()
Returns the minimum logging retrieved from the underlying Log4J logger. |
static NodeLogger |
getLogger(Class<?> c)
Creates a new NodeLogger for the given Class. |
static NodeLogger |
getLogger(String s)
Creates a new NodeLogger for the given name. |
void |
info(Object o)
Write info message into this logger. |
void |
info(Object o,
Throwable t)
Write info message and throwable into this logger. |
boolean |
isDebugEnabled()
Checks if debug logging level is enabled. |
boolean |
isEnabledFor(NodeLogger.LEVEL level)
Returns true if the underlying Log4J logger is enabled for
the given level . |
boolean |
isInfoEnabled()
Checks if info logging level is enabled. |
static void |
removeWriter(Writer writer)
Removes the previously added Writer from the logger. |
static void |
setLevel(NodeLogger.LEVEL level)
Sets an new minimum logging level for all internal appenders, that are, log file, and System.out and System.err
appender. |
static void |
setLevelIntern(NodeLogger.LEVEL level)
Deprecated. |
void |
warn(Object o)
Write warning message into this logger. |
void |
warn(Object o,
Throwable t)
Write warning message and throwable into this logger. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String LOG_FILE
Method Detail |
---|
public static NodeLogger getLogger(Class<?> c)
NodeLogger
for the given Class.
c
- The logger's Class.
public static NodeLogger getLogger(String s)
NodeLogger
for the given name.
s
- The logger's String.
public void warn(Object o)
o
- The object to print.public void debug(Object o)
o
- The object to print.public void info(Object o)
o
- The object to print.public void error(Object o)
o
- The object to print.public void fatal(Object o)
o
- The object to print.public void warn(Object o, Throwable t)
o
- The object to print.t
- The exception to log at debug level, including its stack trace.public void debug(Object o, Throwable t)
o
- The object to print.t
- The exception to log, including its stack trace.public void info(Object o, Throwable t)
o
- The object to print.t
- The exception to log at debug level, including its stack trace.public void error(Object o, Throwable t)
o
- The object to print.t
- The exception to log at debug level, including its stack trace.public void assertLog(boolean b, String m)
b
- The expression to check.m
- Print this message if failed.public void assertLog(boolean b, String m, AssertionError e)
b
- The expression to check.m
- Print this message if failed.e
- AssertionError which as been fired.public void coding(Object o)
o
- The message to print.public void coding(Object o, Throwable t)
o
- The message to print.t
- The exception to log at debug level, including its stack trace.public void fatal(Object o, Throwable t)
o
- The object to print.t
- The exception to log at debug level, including its stack trace.public static final void addWriter(Writer writer, NodeLogger.LEVEL minLevel, NodeLogger.LEVEL maxLevel)
Writer
with the given level to this logger.
writer
- The writer to add.minLevel
- The minimum level to output.maxLevel
- The maximum level to output.public static final void removeWriter(Writer writer)
Writer
from the logger.
writer
- The Writer to remove.@Deprecated public static void setLevelIntern(NodeLogger.LEVEL level)
level
- minimum log levelsetLevel(NodeLogger.LEVEL)
public static void setLevel(NodeLogger.LEVEL level)
System.out
and System.err
appender. The maximum logging level stays LEVEL.ALL
for
all appenders.
level
- new minimum logging levelpublic NodeLogger.LEVEL getLevel()
public boolean isDebugEnabled()
true
if debug logging level is enabled, otherwise
false
public boolean isInfoEnabled()
true
if info logging level is enabled, otherwise
false
public boolean isEnabledFor(NodeLogger.LEVEL level)
true
if the underlying Log4J logger is enabled for
the given level
.
level
- to test logging enabled
true
if logging is enabled, otherwise
false
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |