public class XdevLoggerImpl extends Object implements XdevLogger
XdevLoggerImpl
is the reference implementation of XdevLogger
.
For information regarding logger configuration take a look at LoggingConfiguration
.
Instances of this class are immutable.
Constructor and Description |
---|
XdevLoggerImpl(Logger logger)
Creates a new
XdevLoggerImpl instance utilizing the passed
Logger instance. |
Modifier and Type | Method and Description |
---|---|
void |
debug(String msg)
Log a message at the FINE level.
|
void |
debug(String msg,
Object... args)
Log a message at the FINE level according to the specified message and
arguments.
|
void |
debug(Throwable thrown)
Log an exception (throwable) at the FINE level.
|
void |
debug(Throwable thrown,
String msg)
Log an exception (throwable) at the FINE level with an accompanying
message.
|
void |
error(String msg)
Log a message at the ERROR (SEVERE) level.
|
void |
error(String msg,
Object... args)
Log a message at the ERROR (SEVERE) level according to the specified message and
arguments.
|
void |
error(Throwable thrown)
Log an exception (throwable) at the ERROR (SEVERE) level.
|
void |
error(Throwable thrown,
String msg)
Log an exception (throwable) at the ERROR (SEVERE) level with an accompanying
message.
|
Logger |
getLogger()
Returns
Logger instance that backs this XdevLoggerImpl . |
void |
info(String msg)
Log a message at the INFO level.
|
void |
info(String msg,
Object... args)
Log a message at the INFO level according to the specified message and
arguments.
|
void |
info(Throwable thrown)
Log an exception (throwable) at the INFO level.
|
void |
info(Throwable thrown,
String msg)
Log an exception (throwable) at the WARNING level with an accompanying
message.
|
protected boolean |
isBlacklisted(Throwable t)
Checks if the provided
Throwable t is blacklisted (= should not
be logged). |
boolean |
isDebugEnabled()
Is the logger instance enabled for the FINE level?
|
boolean |
isErrorEnabled()
Is the logger instance enabled for the ERROR level?
|
boolean |
isInfoEnabled()
Is the logger instance enabled for the INFO level?
|
boolean |
isWarningEnabled()
Is the logger instance enabled for the WARNING level?
|
protected void |
log(Level level,
String msg,
Object... args)
Log a message at the provided level according to the specified message
and arguments.
|
protected void |
log(Level level,
String msg,
Throwable ex)
Log an exception (throwable) at the provided level with an accompanying
message.
|
protected void |
log0(Level level,
String msg,
Throwable ex,
Object... args)
Log an exception (throwable) at the provided level with an accompanying
message and arguments.
|
void |
warning(String msg)
Log a message at the WARNING level.
|
void |
warning(String msg,
Object... args)
Log a message at the WARNING level according to the specified message and
arguments.
|
void |
warning(Throwable thrown)
Log an exception (throwable) at the WARNING level.
|
void |
warning(Throwable thrown,
String msg)
Log an exception (throwable) at the WARNING level with an accompanying
message.
|
public XdevLoggerImpl(Logger logger)
XdevLoggerImpl
instance utilizing the passed
Logger
instance.logger
- Logger
instance to back this XdevLoggerImpl
.public void error(Throwable thrown)
XdevLogger
error
in interface XdevLogger
thrown
- the exception (throwable) to logpublic void error(Throwable thrown, String msg)
XdevLogger
error
in interface XdevLogger
thrown
- the exception (throwable) to logmsg
- the message accompanying the exceptionpublic void error(String msg, Object... args)
XdevLogger
The arguments will be integrated using the MessageFormat
syntax.
error
in interface XdevLogger
msg
- the format stringargs
- an array of argumentsMessageFormat
public void warning(Throwable thrown)
XdevLogger
warning
in interface XdevLogger
thrown
- the exception (throwable) to logpublic void warning(Throwable thrown, String msg)
XdevLogger
warning
in interface XdevLogger
thrown
- the exception (throwable) to logmsg
- the message accompanying the exceptionpublic void warning(String msg, Object... args)
XdevLogger
The arguments will be integrated using the MessageFormat
syntax.
warning
in interface XdevLogger
msg
- the format stringargs
- an array of argumentsMessageFormat
public void info(Throwable thrown)
XdevLogger
info
in interface XdevLogger
thrown
- the exception (throwable) to logpublic void info(Throwable thrown, String msg)
XdevLogger
info
in interface XdevLogger
thrown
- the exception (throwable) to logmsg
- the message accompanying the exceptionpublic void info(String msg, Object... args)
XdevLogger
The arguments will be integrated using the MessageFormat
syntax.
info
in interface XdevLogger
msg
- the format stringargs
- an array of argumentsMessageFormat
public void info(String msg)
XdevLogger
info
in interface XdevLogger
msg
- the message to logpublic boolean isDebugEnabled()
XdevLogger
isDebugEnabled
in interface XdevLogger
true
if this Logger is enabled for the FINE level,
false
otherwise.public boolean isErrorEnabled()
XdevLogger
isErrorEnabled
in interface XdevLogger
true
if this Logger is enabled for the ERROR level,
false
otherwise.public boolean isWarningEnabled()
XdevLogger
isWarningEnabled
in interface XdevLogger
true
if this Logger is enabled for the WARNING
level, false
otherwise.public boolean isInfoEnabled()
XdevLogger
isInfoEnabled
in interface XdevLogger
true
if this Logger is enabled for the INFO level,
false
otherwise.public void debug(Throwable thrown)
XdevLogger
debug
in interface XdevLogger
thrown
- the exception (throwable) to logpublic void debug(Throwable thrown, String msg)
XdevLogger
debug
in interface XdevLogger
thrown
- the exception (throwable) to logmsg
- the message accompanying the exceptionpublic void debug(String msg, Object... args)
XdevLogger
The arguments will be integrated using the MessageFormat
syntax.
debug
in interface XdevLogger
msg
- the format stringargs
- an array of argumentsMessageFormat
public void debug(String msg)
XdevLogger
debug
in interface XdevLogger
msg
- the message to logpublic void warning(String msg)
XdevLogger
warning
in interface XdevLogger
msg
- the message to logpublic void error(String msg)
XdevLogger
error
in interface XdevLogger
msg
- the message to logprotected void log(Level level, String msg, Object... args)
The arguments will be integrated using the MessageFormat
syntax.
level
- Level
to log onmsg
- the format stringargs
- an array of argumentsMessageFormat
protected void log(Level level, String msg, Throwable ex)
level
- Level
to log onmsg
- the message accompanying the exceptionex
- the exception (throwable) to logprotected void log0(Level level, String msg, Throwable ex, Object... args)
The arguments will be integrated using the MessageFormat
syntax.
level
- Level
to log onmsg
- the message accompanying the exceptionex
- the exception (throwable) to logargs
- an array of argumentsprotected boolean isBlacklisted(Throwable t)
Throwable
t is blacklisted (= should not
be logged).
This method is used to filter JRE bugs/messages with no effect.
public Logger getLogger()
XdevLogger
Logger
instance that backs this XdevLoggerImpl
.getLogger
in interface XdevLogger
Logger
instance that backs this XdevLoggerImpl
.Copyright © 2003–2021 XDEV Software. All rights reserved.