Class AbstractCouchbaseLogger
java.lang.Object
com.couchbase.client.core.logging.AbstractCouchbaseLogger
- All Implemented Interfaces:
CouchbaseLogger
,Serializable
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()
.- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Log an exception (throwable) at the DEBUG level.void
Log an exception (throwable) at the ERROR level.void
Log an exception (throwable) at the INFO level.boolean
isEnabled
(CouchbaseLogLevel level) Is the logger instance enabled for the specifiedlevel
?void
log
(CouchbaseLogLevel level, String msg) Log a message at the specifiedlevel
.void
log
(CouchbaseLogLevel level, String format, Object arg) Log a message at the specifiedlevel
according to the specified format and argument.void
log
(CouchbaseLogLevel level, String format, Object... arguments) Log a message at the specifiedlevel
according to the specified format and arguments.void
log
(CouchbaseLogLevel level, String format, Object argA, Object argB) Log a message at the specifiedlevel
according to the specified format and arguments.void
log
(CouchbaseLogLevel level, String msg, Throwable cause) Log an exception (throwable) at the specifiedlevel
with an accompanying message.void
log
(CouchbaseLogLevel level, Throwable cause) Log an exception (throwable) at the specifiedlevel
.name()
Return the name of thisCouchbaseLogger
instance.protected Object
toString()
void
Log an exception (throwable) at the TRACE level.void
Log an exception (throwable) at the WARN level.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.couchbase.client.core.logging.CouchbaseLogger
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
-
Constructor Details
-
AbstractCouchbaseLogger
Creates a new instance.
-
-
Method Details
-
name
Description copied from interface:CouchbaseLogger
Return the name of thisCouchbaseLogger
instance.- Specified by:
name
in interfaceCouchbaseLogger
- Returns:
- name of this logger instance
-
isEnabled
Description copied from interface:CouchbaseLogger
Is the logger instance enabled for the specifiedlevel
?- Specified by:
isEnabled
in interfaceCouchbaseLogger
- Returns:
- True if this Logger is enabled for the specified
level
, false otherwise.
-
trace
Description copied from interface:CouchbaseLogger
Log an exception (throwable) at the TRACE level.- Specified by:
trace
in interfaceCouchbaseLogger
- Parameters:
t
- the exception (throwable) to log
-
debug
Description copied from interface:CouchbaseLogger
Log an exception (throwable) at the DEBUG level.- Specified by:
debug
in interfaceCouchbaseLogger
- Parameters:
t
- the exception (throwable) to log
-
info
Description copied from interface:CouchbaseLogger
Log an exception (throwable) at the INFO level.- Specified by:
info
in interfaceCouchbaseLogger
- Parameters:
t
- the exception (throwable) to log
-
warn
Description copied from interface:CouchbaseLogger
Log an exception (throwable) at the WARN level.- Specified by:
warn
in interfaceCouchbaseLogger
- Parameters:
t
- the exception (throwable) to log
-
error
Description copied from interface:CouchbaseLogger
Log an exception (throwable) at the ERROR level.- Specified by:
error
in interfaceCouchbaseLogger
- Parameters:
t
- the exception (throwable) to log
-
log
Description copied from interface:CouchbaseLogger
Log an exception (throwable) at the specifiedlevel
with an accompanying message.- Specified by:
log
in interfaceCouchbaseLogger
msg
- the message accompanying the exceptioncause
- the exception (throwable) to log
-
log
Description copied from interface:CouchbaseLogger
Log an exception (throwable) at the specifiedlevel
.- Specified by:
log
in interfaceCouchbaseLogger
cause
- the exception (throwable) to log
-
log
Description copied from interface:CouchbaseLogger
Log a message at the specifiedlevel
.- Specified by:
log
in interfaceCouchbaseLogger
msg
- the message string to be logged
-
log
Description copied from interface:CouchbaseLogger
Log a message at the specifiedlevel
according to the specified format and argument.This form avoids superfluous object creation when the logger is disabled for the specified
level
.- Specified by:
log
in interfaceCouchbaseLogger
format
- the format stringarg
- the argument
-
log
Description copied from interface:CouchbaseLogger
Log a message at the specifiedlevel
according to the specified format and arguments.This form avoids superfluous object creation when the logger is disabled for the specified
level
.- Specified by:
log
in interfaceCouchbaseLogger
format
- the format stringargA
- the first argumentargB
- the second argument
-
log
Description copied from interface:CouchbaseLogger
Log a message at the specifiedlevel
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 anObject[]
before invoking the method, even if this logger is disabled for the specifiedlevel
. The variants takingone
andtwo
arguments exist solely in order to avoid this hidden cost.- Specified by:
log
in interfaceCouchbaseLogger
format
- the format stringarguments
- a list of 3 or more arguments
-
readResolve
- Throws:
ObjectStreamException
-
toString
-