|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.fhg.igd.logging.LoggerProxy
This is a proxy class used by the LoggerFactory
for wrapping
LoggerImpl
instances in order to be able to exchange loggers
easily in case of configuration change requests.
Field Summary | |
protected String |
name_
The name of this proxy |
(package private) LoggerImpl |
target_
The target Logger implementation |
Constructor Summary | |
(package private) |
LoggerProxy(Class wclazz,
String name,
String group)
Hidden construction. |
Method Summary | |
void |
caught(LogLevel level,
String msg,
Throwable thrown)
This method implicitely calls log(de.fhg.igd.logging.LogLevel, java.lang.String) first, then
caught(Throwable) . |
void |
caught(Throwable thrown)
This method is supposed to be used for logging the catching of a Throwable (and subclasses). |
(package private) LoggerImpl |
createBetterTarget()
In case there is a better matching target for this proxy, request and return its instance. |
void |
debug(String msg)
Creates a log entry on LogLevel.DEBUG . |
void |
entering()
This method is supposed to be used for logging the entry of a parameterless method. |
void |
entering(Object[] params)
This method is supposed to be used for logging the entry of a method with a set of parameters. |
boolean |
equals(Object obj)
|
void |
error(String msg)
Creates a log entry on LogLevel.ERROR . |
void |
exiting()
This method is supposed to be used for logging the exit of a method without return value. |
void |
exiting(Object result)
This method is supposed to be used for logging the exit of a method with a return value. |
void |
fatal(String msg)
Creates a log entry on LogLevel.FATAL . |
void |
finalize()
This method will be called by the garbage collector as soon as this proxy is no longer referenced. |
String |
getName()
|
(package private) LoggerImpl |
getTarget()
|
int |
hashCode()
|
void |
info(String msg)
Creates a log entry on LogLevel.INFO . |
boolean |
isEnabled(LogLevel level)
Find out if logging would be performed at the given log level. |
void |
log(LogLevel level,
String msg)
This is the generic log method to be used for creating a log entry on the specified log level. |
void |
severe(String msg)
Creates a log entry on LogLevel.SEVERE . |
void |
throwing(LogLevel level,
String msg,
Throwable thrown)
This method implicitely calls log(de.fhg.igd.logging.LogLevel, java.lang.String) first, then
throwing(Throwable) . |
void |
throwing(Throwable thrown)
This method is supposed to be used for logging the creation and method exit by a Throwable (and subclasses). |
String |
toString()
|
void |
trace(String msg)
Creates a log entry on LogLevel.TRACE . |
(package private) void |
updateTarget(LoggerImpl target)
Exchange the target of this proxy. |
void |
warning(String msg)
Creates a log entry on LogLevel.WARNING . |
Methods inherited from class java.lang.Object |
clone, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected String name_
LoggerImpl target_
Logger
implementation
Constructor Detail |
LoggerProxy(Class wclazz, String name, String group)
wclazz
- The Wrapper
implementation class to be usedname
- The name of this proxygroup
- The group of this proxy and the target loggerMethod Detail |
public String getName()
LoggerImpl getTarget()
LoggerImpl createBetterTarget()
null
.
null
if there is no better match availablevoid updateTarget(LoggerImpl target)
target
- The new target for this proxypublic void log(LogLevel level, String msg)
Logger
log
in interface Logger
level
- The log level to be used for creating the log entrymsg
- The message to be written into the log entrypublic void trace(String msg)
Logger
LogLevel.TRACE
.
trace
in interface Logger
msg
- The message to be written into the log entrypublic void debug(String msg)
Logger
LogLevel.DEBUG
.
debug
in interface Logger
msg
- The message to be written into the log entrypublic void info(String msg)
Logger
LogLevel.INFO
.
info
in interface Logger
msg
- The message to be written into the log entrypublic void warning(String msg)
Logger
LogLevel.WARNING
.
warning
in interface Logger
msg
- The message to be written into the log entrypublic void error(String msg)
Logger
LogLevel.ERROR
.
error
in interface Logger
msg
- The message to be written into the log entrypublic void severe(String msg)
Logger
LogLevel.SEVERE
.
severe
in interface Logger
msg
- The message to be written into the log entrypublic void fatal(String msg)
Logger
LogLevel.FATAL
.
fatal
in interface Logger
msg
- The message to be written into the log entrypublic void entering()
Logger
LogLevel.TRACE
.
entering
in interface Logger
public void entering(Object[] params)
Logger
LogLevel.TRACE
.
entering
in interface Logger
params
- The method parameters, for printing the
toString()
method will be called on each objectpublic void exiting()
Logger
LogLevel.TRACE
.
exiting
in interface Logger
public void exiting(Object result)
Logger
LogLevel.TRACE
.
exiting
in interface Logger
result
- The return value, for printing the
toString()
method will be calledpublic void throwing(Throwable thrown)
Logger
Throwable
(and subclasses). Hereby, the used
log level will be LogLevel.TRACE
.
throwing
in interface Logger
thrown
- The exception that will be thrownpublic void throwing(LogLevel level, String msg, Throwable thrown)
Logger
Logger.log(de.fhg.igd.logging.LogLevel, java.lang.String)
first, then
Logger.throwing(Throwable)
.
throwing
in interface Logger
level
- The log level to be used for creating the log entrymsg
- The message to be written into the log entrythrown
- The exception that will be thrownpublic void caught(Throwable thrown)
Logger
Throwable
(and subclasses). Hereby, the used
log level will be LogLevel.TRACE
.
caught
in interface Logger
thrown
- The exception that has been caughtpublic void caught(LogLevel level, String msg, Throwable thrown)
Logger
Logger.log(de.fhg.igd.logging.LogLevel, java.lang.String)
first, then
Logger.caught(Throwable)
.
caught
in interface Logger
level
- The log level to be used for creating the log entrymsg
- The message to be written into the log entrythrown
- The exception that has been caughtpublic boolean isEnabled(LogLevel level)
Logger
This method might be useful in cases of costly log message creation which should be performed only if really needed.
isEnabled
in interface Logger
level
- The log level to check for
public void finalize()
public boolean equals(Object obj)
public int hashCode()
public String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |