public class BasicLogger extends java.lang.Object implements TopicalLogger, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected java.util.HashMap |
handlers
This fields references by their name the handlers associated to the
logger.
|
protected Level |
level
The current level of the logger.
|
protected LevelFactory |
levelFactory
This field references the level factory.
|
protected java.util.ArrayList |
topics
The fields lists all topics the logger.
|
APPEND_MODE_ATTRIBUTE, BUFFER_ATTRIBUTE, CONSOLE_HANDLER_TYPE, FILE_HANDLER_TYPE, FILE_NUMBER_ATTRIBUTE, GENERIC_HANDLER_TYPE, JMX_HANDLER_TYPE, LEVEL_ATTRIBUTE, LOGGER_HANDLER_TYPE, MAX_SIZE_ATTRIBUTE, OUTPUT_ATTRIBUTE, PATTERN_ATTRIBUTE, ROLLING_FILE_HANDLER_TYPE
Modifier and Type | Method and Description |
---|---|
void |
addHandler(Handler h)
A TopicalLogger manages a list of Handler instances.
|
void |
addTopic(java.lang.String topic)
This method allows adding a topic to a TopicalLogger.
|
boolean |
getAdditivity()
It retrieves the additivity flag for this logger instance.
|
java.lang.Object |
getAttribute(java.lang.String name)
It retrieves the value of an attribute value of the handler.
|
java.lang.String[] |
getAttributeNames()
It retrieves the attributes of the handler
|
int |
getCurrentIntLevel()
Returns the current level value under the integer format
|
Level |
getCurrentLevel()
Returns the current level value under the Level format
|
Handler[] |
getHandler()
It returns the list of the handler associated to this logger.
|
Handler |
getHandler(java.lang.String hn)
It returns the handler which the name is equals to the parameter
|
java.lang.String |
getName()
It retrieves the name of the handler
|
java.lang.String[] |
getTopic()
This method allows getting a topic list of this TopicalLogger.
|
java.util.Enumeration |
getTopics()
TODO
|
java.lang.String |
getType()
It retrieves the Handler type
|
boolean |
isLoggable(int level)
Check if a message of the given level would actually be logged by this logger.
|
boolean |
isLoggable(Level l)
Check if a message of the given level would actually be logged by this logger.
|
boolean |
isOn()
Check if this logger is enabled.
|
void |
log(int level,
java.lang.Object message)
Log a message, with no arguments.
|
void |
log(int level,
java.lang.Object message,
java.lang.Object location,
java.lang.Object method)
Log a message, with a location and method arguments.
|
void |
log(int level,
java.lang.Object message,
java.lang.Throwable throwable)
Log a message, with a throwable arguments which can represent an
error or a context..
|
void |
log(int level,
java.lang.Object message,
java.lang.Throwable throwable,
java.lang.Object location,
java.lang.Object method)
Log a message, with a location, method and throwable arguments.
|
void |
log(Level level,
java.lang.Object message)
Log a message, with no arguments.
|
void |
log(Level l,
java.lang.Object message,
java.lang.Object location,
java.lang.Object method)
Log a message, with a location and method arguments.
|
void |
log(Level level,
java.lang.Object message,
java.lang.Throwable throwable)
Log a message, with a throwable arguments which can represent an
error or a context..
|
void |
log(Level level,
java.lang.Object message,
java.lang.Throwable throwable,
java.lang.Object location,
java.lang.Object method)
Log a message, with a location, method and throwable arguments.
|
void |
removeAllHandlers()
A TopicalLogger manages a list of Handler instances.
|
void |
removeHandler(Handler h)
A TopicalLogger manages a list of Handler instances.
|
void |
removeTopic(java.lang.String topic)
This method allows removing a topic to a TopicalLogger.
|
void |
setAdditivity(boolean a)
It assigns the additivity flag for this logger instance.
|
java.lang.Object |
setAttribute(java.lang.String name,
java.lang.Object value)
It assigns an attributte to the handler.
|
void |
setIntLevel(int l)
Permits to set the level with an integer value
|
void |
setLevel(Level l)
Permits to set the level with a Level instance.
|
void |
setName(java.lang.String name)
It assigns the name of the handler
|
void |
turnOff()
Disables this logger
|
void |
turnOn()
Enables this logger
|
protected java.util.HashMap handlers
protected java.util.ArrayList topics
protected LevelFactory levelFactory
protected Level level
public void addHandler(Handler h) throws java.lang.Exception
TopicalLogger
addHandler
in interface TopicalLogger
java.lang.Exception
public void removeHandler(Handler h) throws java.lang.Exception
TopicalLogger
removeHandler
in interface TopicalLogger
java.lang.Exception
public Handler[] getHandler()
TopicalLogger
getHandler
in interface TopicalLogger
public Handler getHandler(java.lang.String hn)
TopicalLogger
getHandler
in interface TopicalLogger
public void removeAllHandlers() throws java.lang.Exception
TopicalLogger
removeAllHandlers
in interface TopicalLogger
java.lang.Exception
public void setAdditivity(boolean a)
TopicalLogger
setAdditivity
in interface TopicalLogger
public boolean getAdditivity()
TopicalLogger
getAdditivity
in interface TopicalLogger
public void addTopic(java.lang.String topic) throws java.lang.Exception
TopicalLogger
addTopic
in interface TopicalLogger
java.lang.Exception
public java.util.Enumeration getTopics()
getTopics
in interface TopicalLogger
public java.lang.String[] getTopic()
TopicalLogger
getTopic
in interface TopicalLogger
public void removeTopic(java.lang.String topic) throws java.lang.Exception
TopicalLogger
removeTopic
in interface TopicalLogger
java.lang.Exception
public java.lang.String getName()
Handler
public void setName(java.lang.String name)
Handler
public java.lang.String getType()
Handler
public java.lang.String[] getAttributeNames()
Handler
getAttributeNames
in interface Handler
public java.lang.Object getAttribute(java.lang.String name)
Handler
getAttribute
in interface Handler
name
- is an attribute namepublic java.lang.Object setAttribute(java.lang.String name, java.lang.Object value)
Handler
setAttribute
in interface Handler
name
- is the attribute namevalue
- is the attribute valuepublic void setIntLevel(int l)
Logger
setIntLevel
in interface Logger
public void setLevel(Level l)
Logger
public int getCurrentIntLevel()
Logger
getCurrentIntLevel
in interface Logger
public Level getCurrentLevel()
Logger
getCurrentLevel
in interface Logger
public boolean isLoggable(int level)
Logger
isLoggable
in interface Logger
public boolean isLoggable(Level l)
Logger
isLoggable
in interface Logger
public boolean isOn()
Logger
public void log(int level, java.lang.Object message)
Logger
public void log(Level level, java.lang.Object message)
Logger
public void log(int level, java.lang.Object message, java.lang.Throwable throwable)
Logger
public void log(Level level, java.lang.Object message, java.lang.Throwable throwable)
Logger
public void log(int level, java.lang.Object message, java.lang.Object location, java.lang.Object method)
Logger
public void log(Level l, java.lang.Object message, java.lang.Object location, java.lang.Object method)
Logger
public void log(int level, java.lang.Object message, java.lang.Throwable throwable, java.lang.Object location, java.lang.Object method)
Logger
public void log(Level level, java.lang.Object message, java.lang.Throwable throwable, java.lang.Object location, java.lang.Object method)
Logger
public void turnOn()
Logger