com.foxinmy.weixin4j.logging
Class AbstractInternalLogger

java.lang.Object
  extended by com.foxinmy.weixin4j.logging.AbstractInternalLogger
All Implemented Interfaces:
InternalLogger, Serializable

public abstract class AbstractInternalLogger
extends Object
implements InternalLogger, Serializable

A skeletal implementation of InternalLogger. This class implements all methods that have a InternalLogLevel parameter by default to call specific logger methods such as InternalLogger.info(String) or InternalLogger.isInfoEnabled().

See Also:
Serialized Form

Method Summary
 boolean isEnabled(InternalLogLevel level)
          Is the logger instance enabled for the specified level?
 void log(InternalLogLevel level, String msg)
          Log a message at the specified level.
 void log(InternalLogLevel level, String format, Object... arguments)
          Log a message at the specified level according to the specified format and arguments.
 void log(InternalLogLevel level, String format, Object arg)
          Log a message at the specified level according to the specified format and argument.
 void log(InternalLogLevel level, String format, Object argA, Object argB)
          Log a message at the specified level according to the specified format and arguments.
 void log(InternalLogLevel level, String msg, Throwable cause)
          Log an exception (throwable) at the specified level with an accompanying message.
 String name()
          Return the name of this InternalLogger instance.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.foxinmy.weixin4j.logging.InternalLogger
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
 

Method Detail

name

public String name()
Description copied from interface: InternalLogger
Return the name of this InternalLogger instance.

Specified by:
name in interface InternalLogger
Returns:
name of this logger instance

isEnabled

public boolean isEnabled(InternalLogLevel level)
Description copied from interface: InternalLogger
Is the logger instance enabled for the specified level?

Specified by:
isEnabled in interface InternalLogger
Returns:
True if this Logger is enabled for the specified level, false otherwise.

log

public void log(InternalLogLevel level,
                String msg,
                Throwable cause)
Description copied from interface: InternalLogger
Log an exception (throwable) at the specified level with an accompanying message.

Specified by:
log in interface InternalLogger
msg - the message accompanying the exception
cause - the exception (throwable) to log

log

public void log(InternalLogLevel level,
                String msg)
Description copied from interface: InternalLogger
Log a message at the specified level.

Specified by:
log in interface InternalLogger
msg - the message string to be logged

log

public void log(InternalLogLevel level,
                String format,
                Object arg)
Description copied from interface: InternalLogger
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.

Specified by:
log in interface InternalLogger
format - the format string
arg - the argument

log

public void log(InternalLogLevel level,
                String format,
                Object argA,
                Object argB)
Description copied from interface: InternalLogger
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.

Specified by:
log in interface InternalLogger
format - the format string
argA - the first argument
argB - the second argument

log

public void log(InternalLogLevel level,
                String format,
                Object... arguments)
Description copied from interface: InternalLogger
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.

Specified by:
log in interface InternalLogger
format - the format string
arguments - a list of 3 or more arguments

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2014–2017. All rights reserved.