public final class AgentLogger
extends java.util.logging.Logger
| Modifier and Type | Field and Description |
|---|---|
static java.util.logging.Formatter |
AGENT_FILE_FORMATTER
Defines the default file formatter as : LOG_LEVEL : message
|
static java.util.logging.Formatter |
AGENT_FORMATTER
Defines the default formatter as : [agent's name] LOG_LEVEL : message
|
| Modifier and Type | Method and Description |
|---|---|
void |
addHandler(java.util.logging.Handler handler) |
void |
createLogFile()
Creates a log file for this logger.
|
static void |
createLogFiles()
Create a log file for each agent having a non
null logger. |
java.util.logging.Level |
getWarningLogLevel()
Returns the log level above which MaDKit warnings are displayed
for the corresponding agent.
|
void |
log(java.util.logging.LogRecord record) |
static void |
setAllLogLevels(java.util.logging.Level level)
Set all the agents' loggers to the specified level
|
void |
setLevel(java.util.logging.Level newLevel)
Set the log level for the corresponding agent.
|
void |
setWarningLogLevel(java.util.logging.Level warningLogLevel)
Sets the agent's log level above which MaDKit warnings are displayed
|
void |
severeLog(java.lang.String msg)
This call bypasses any settings and always produces severe log
messages.
|
void |
severeLog(java.lang.String msg,
java.lang.Throwable t)
This call bypasses any settings and always produces severe log
messages which display the stack trace of the throwable if it is
not
null |
void |
talk(java.lang.String msg)
Log a TALK message.
|
java.lang.String |
toString() |
config, entering, entering, entering, exiting, exiting, fine, finer, finest, getAnonymousLogger, getAnonymousLogger, getFilter, getGlobal, getHandlers, getLevel, getLogger, getLogger, getName, getParent, getResourceBundle, getResourceBundleName, getUseParentHandlers, info, isLoggable, log, log, log, log, logp, logp, logp, logp, logrb, logrb, logrb, logrb, removeHandler, setFilter, setParent, setUseParentHandlers, severe, throwing, warningpublic static final java.util.logging.Formatter AGENT_FORMATTER
public static final java.util.logging.Formatter AGENT_FILE_FORMATTER
public java.util.logging.Level getWarningLogLevel()
public void setWarningLogLevel(java.util.logging.Level warningLogLevel)
warningLogLevel - the log level to setpublic void createLogFile()
Madkit.Option.logDirectory,
which is set to "logs" by default.public void addHandler(java.util.logging.Handler handler)
throws java.lang.SecurityException
addHandler in class java.util.logging.Loggerjava.lang.SecurityExceptionpublic void talk(java.lang.String msg)
If the logger's level is not Level.OFF then the given message is forwarded to all the registered output Handler objects.
If the logger's level is Level.OFF then the message is only printed to System.out
msg - The string messagepublic void setLevel(java.util.logging.Level newLevel)
throws java.lang.SecurityException
setLevel in class java.util.logging.Loggerjava.lang.SecurityExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic void log(java.util.logging.LogRecord record)
log in class java.util.logging.Loggerpublic void severeLog(java.lang.String msg,
java.lang.Throwable t)
nullmsg - the message to displayt - the related exception if any. It can be nullpublic void severeLog(java.lang.String msg)
msg - the message to displaypublic static void setAllLogLevels(java.util.logging.Level level)
level - the new levelpublic static void createLogFiles()
null logger.createLogFile()
Fabien Michel, Olivier Gutknecht, Jacques Ferber - November 18 2014