|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.base.utils.logging.AbstractAgentLogger cz.cuni.amis.pogamut.base.utils.logging.AgentLogger
public class AgentLogger
All logging apis are fine ... but we don't want to have loggers for classes but for instances - therefore we've created our wrapper allowing you to do two things quickly:
2) this may prove crucial for your debugging to have own logger for planner and another for emotions of your agents, etc.
Simply - every Agent instance (starting with the first abstract class AbstractAgent) has instance of this class (which is java.logging.Logger(s) wrapper).
Every agent's component has own LogCategory
and you may obtain your own via getCategory() method.
LogCategory
serves as a gateway for your log messages, it contains methods as you
know them from java.logging API (things like fine(), info(), severe(), log(Level, msg), etc.).
Plus it allows you to obtain new LogHandler
instances for that category (if you need to
publish log messages from that category somewhere else).
Every LogHandler
serves for filtering messages for one category and publishing them
into one end (console, file, memory, whatever...).
Additionally every LogCategory
has AgentLogger
as its parent.
Field Summary |
---|
Fields inherited from class cz.cuni.amis.pogamut.base.utils.logging.AbstractAgentLogger |
---|
agentId, LOG_CATEGORY_NAME |
Constructor Summary | |
---|---|
AgentLogger(IAgentId agentId)
|
Method Summary | |
---|---|
void |
enableJMX(MBeanServer mBeanServer,
ObjectName parent)
Method for starting the JMX extension of the class. |
static ObjectName |
getJMXAgentLoggerName(ObjectName parent)
|
protected ILogCategories |
getLogCategories()
|
Methods inherited from class cz.cuni.amis.pogamut.base.utils.logging.AbstractAgentLogger |
---|
addDefaultConsoleHandler, addDefaultFileHandler, addDefaultHandler, addDefaultNetworkHandler, addDefaultPublisher, addToAllCategories, addToAllCategories, getAgentId, getCategories, getCategory, getCategory, getDefaultConsoleHandler, getDefaultNetworkHandler, getNetworkLoggerHost, getNetworkLoggerPort, isDefaultConsoleHandler, isDefaultNetworkHandler, removeDefaultConsoleHandler, removeDefaultHandler, removeDefaultNetworkHandler, removeFromAllCategories, setLevel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
@Inject public AgentLogger(IAgentId agentId)
Method Detail |
---|
public static ObjectName getJMXAgentLoggerName(ObjectName parent)
public void enableJMX(MBeanServer mBeanServer, ObjectName parent) throws JMXAlreadyEnabledException, CantStartJMXException
IJMXEnabled
Object should register whatever objects it wants to expose via JMX.
mBeanServer
- server where the MBean of agent is registeredparent
- parent's ObjectName, should be used as base of name of
the registered MBean
JMXAlreadyEnabledException
CantStartJMXException
protected ILogCategories getLogCategories()
getLogCategories
in class AbstractAgentLogger
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |