public abstract class AbstractCouchbaseLogger extends Object implements CouchbaseLogger, Serializable
A skeletal implementation of CouchbaseLogger
. This class implements all methods that have a CouchbaseLogLevel
parameter by default to call specific logger methods such as CouchbaseLogger.info(String)
or CouchbaseLogger.isInfoEnabled()
.
Modifier | Constructor and Description |
---|---|
protected |
AbstractCouchbaseLogger(String name)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
debug(Throwable t)
Log an exception (throwable) at the DEBUG level.
|
void |
error(Throwable t)
Log an exception (throwable) at the ERROR level.
|
void |
info(Throwable t)
Log an exception (throwable) at the INFO level.
|
boolean |
isEnabled(CouchbaseLogLevel level)
Is the logger instance enabled for the specified
level ? |
void |
log(CouchbaseLogLevel level,
String msg)
Log a message at the specified
level . |
void |
log(CouchbaseLogLevel level,
String format,
Object... arguments)
Log a message at the specified
level according to the specified format and arguments. |
void |
log(CouchbaseLogLevel level,
String format,
Object arg)
Log a message at the specified
level according to the specified format and argument. |
void |
log(CouchbaseLogLevel level,
String format,
Object argA,
Object argB)
Log a message at the specified
level according to the specified format and arguments. |
void |
log(CouchbaseLogLevel level,
String msg,
Throwable cause)
Log an exception (throwable) at the specified
level with an accompanying message. |
void |
log(CouchbaseLogLevel level,
Throwable cause)
Log an exception (throwable) at the specified
level . |
String |
name()
Return the name of this
CouchbaseLogger instance. |
protected Object |
readResolve() |
String |
toString() |
void |
trace(Throwable t)
Log an exception (throwable) at the TRACE level.
|
void |
warn(Throwable t)
Log an exception (throwable) at the WARN level.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
debug, debug, debug, debug, debug, error, error, error, error, error, info, info, info, info, info, isDebugEnabled, isErrorEnabled, isInfoEnabled, isTraceEnabled, isWarnEnabled, trace, trace, trace, trace, trace, warn, warn, warn, warn, warn
protected AbstractCouchbaseLogger(String name)
Creates a new instance.
public String name()
CouchbaseLogger
Return the name of this CouchbaseLogger
instance.
name
in interface CouchbaseLogger
public boolean isEnabled(CouchbaseLogLevel level)
CouchbaseLogger
Is the logger instance enabled for the specified level
?
isEnabled
in interface CouchbaseLogger
level
, false otherwise.public void trace(Throwable t)
CouchbaseLogger
Log an exception (throwable) at the TRACE level.
trace
in interface CouchbaseLogger
t
- the exception (throwable) to logpublic void debug(Throwable t)
CouchbaseLogger
Log an exception (throwable) at the DEBUG level.
debug
in interface CouchbaseLogger
t
- the exception (throwable) to logpublic void info(Throwable t)
CouchbaseLogger
Log an exception (throwable) at the INFO level.
info
in interface CouchbaseLogger
t
- the exception (throwable) to logpublic void warn(Throwable t)
CouchbaseLogger
Log an exception (throwable) at the WARN level.
warn
in interface CouchbaseLogger
t
- the exception (throwable) to logpublic void error(Throwable t)
CouchbaseLogger
Log an exception (throwable) at the ERROR level.
error
in interface CouchbaseLogger
t
- the exception (throwable) to logpublic void log(CouchbaseLogLevel level, String msg, Throwable cause)
CouchbaseLogger
Log an exception (throwable) at the specified level
with an accompanying message.
log
in interface CouchbaseLogger
msg
- the message accompanying the exceptioncause
- the exception (throwable) to logpublic void log(CouchbaseLogLevel level, Throwable cause)
CouchbaseLogger
Log an exception (throwable) at the specified level
.
log
in interface CouchbaseLogger
cause
- the exception (throwable) to logpublic void log(CouchbaseLogLevel level, String msg)
CouchbaseLogger
Log a message at the specified level
.
log
in interface CouchbaseLogger
msg
- the message string to be loggedpublic void log(CouchbaseLogLevel level, String format, Object arg)
CouchbaseLogger
Log a message at the specified level
according to the specified format and argument.
This form avoids superfluous object creation when the logger is disabled for the specified level
.
log
in interface CouchbaseLogger
format
- the format stringarg
- the argumentpublic void log(CouchbaseLogLevel level, String format, Object argA, Object argB)
CouchbaseLogger
Log a message at the specified level
according to the specified format and arguments.
This form avoids superfluous object creation when the logger is disabled for the specified level
.
log
in interface CouchbaseLogger
format
- the format stringargA
- the first argumentargB
- the second argumentpublic void log(CouchbaseLogLevel level, String format, Object... arguments)
CouchbaseLogger
Log a message at the specified level
according to the specified format and arguments.
This form avoids superfluous string concatenation when the logger is disabled for the specified level
. However, this variant incurs the hidden (and relatively small) cost of creating an Object[]
before invoking the method, even if this logger is disabled for the specified level
. The variants taking one
and two
arguments exist solely in order to avoid this hidden cost.
log
in interface CouchbaseLogger
format
- the format stringarguments
- a list of 3 or more argumentsprotected Object readResolve() throws ObjectStreamException
ObjectStreamException
Copyright © 2016 Couchbase, Inc.. All rights reserved.