|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
The LoggingManager is used by all other components to log debug and information messages. Furthermore, an implementation can register itself as a listener on other components and log their actions automatically.
The LoggingManager implementation can be configured with the key cf.loggingmanager
in the ConsensusFoundation.properties configuration file. It's a core component and not optional.
The implementation is loaded by the ConsensusFoundation constructor. For successful instantiation,
the LoggingManager implementation must provide a default constructor without arguments.
ConsensusFoundation| Field Summary | |
static int |
LEVEL_ALL
The loglevel at which all messages are logged. |
static int |
LEVEL_DEBUG
The loglevel at which fatal, error, warning, information and debug messages are logged. |
static int |
LEVEL_ERROR
The loglevel at which fatal and error messages are logged. |
static int |
LEVEL_FATAL
The loglevel at which only fatal messages are logged. |
static int |
LEVEL_INFO
The loglevel at which fatal, error, warning and information messages are logged. |
static int |
LEVEL_OFF
The loglevel at which no messages are logged at all. |
static int |
LEVEL_WARN
The loglevel at which fatal, error and warning messages are logged. |
| Method Summary | |
void |
debug(Object message)
Logs the given message if the debug loglevel is active. |
void |
error(Object message)
Logs the given message if the error loglevel is active. |
void |
fatal(Object message)
Logs the given message if the fatal loglevel is active. |
int |
getLevel()
Returns the current loglevel. |
void |
info(Object message)
Logs the given message if the info loglevel is active. |
void |
init(Properties config)
This method is called by the ConsensusFoundation constructor to initialize the LoggingManager. |
boolean |
isDebugEnabled()
Checks if the debug loglevel is enabled. |
boolean |
isErrorEnabled()
Checks if the error loglevel is enabled. |
boolean |
isFatalEnabled()
Checks if the fatal loglevel is enabled. |
boolean |
isInfoEnabled()
Checks if the info loglevel is enabled. |
boolean |
isWarnEnabled()
Checks if the warning loglevel is enabled. |
void |
setLevel(int level)
Changes the loglevel. |
void |
warn(Object message)
Logs the given message if the warning loglevel is active. |
| Methods inherited from interface de.uka.ipd.consensus.foundation.ConsensusFoundationModule |
getConsensusFoundationManager, getVersion, initCompleted, shutdown |
| Field Detail |
public static final int LEVEL_ALL
setLevel(int),
Constant Field Valuespublic static final int LEVEL_DEBUG
setLevel(int),
Constant Field Valuespublic static final int LEVEL_INFO
setLevel(int),
Constant Field Valuespublic static final int LEVEL_WARN
setLevel(int),
Constant Field Valuespublic static final int LEVEL_ERROR
setLevel(int),
Constant Field Valuespublic static final int LEVEL_FATAL
setLevel(int),
Constant Field Valuespublic static final int LEVEL_OFF
setLevel(int),
Constant Field Values| Method Detail |
public void init(Properties config)
throws Exception
ConsensusFoundation constructor to initialize the LoggingManager.
config - all entries from ConsensusFoundation.properties
Exception - if any error occurs (startup of the application is aborted in this case)ConsensusFoundation.ConsensusFoundation()public void setLevel(int level)
level - the new loglevelgetLevel()public int getLevel()
Returns the current loglevel. See the loglevel constants in this interface.
To check whether a certain level is active, use one of the isXXXEnabled() methods.
setLevel(int)public boolean isDebugEnabled()
true if debugging messages are logged, false otherwiseLEVEL_DEBUGpublic boolean isInfoEnabled()
true if info messages are logged, false otherwiseLEVEL_INFOpublic boolean isWarnEnabled()
true if warning messages are logged, false otherwiseLEVEL_WARNpublic boolean isErrorEnabled()
true if error messages are logged, false otherwiseLEVEL_ERRORpublic boolean isFatalEnabled()
true if fatal messages are logged, false otherwiseLEVEL_FATALpublic void debug(Object message)
message - the message to be loggedisDebugEnabled()public void info(Object message)
message - the message to be loggedisInfoEnabled()public void warn(Object message)
message - the message to be loggedisWarnEnabled()public void error(Object message)
message - the message to be loggedisErrorEnabled()public void fatal(Object message)
message - the message to be loggedisFatalEnabled()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||