mazz.i18n.commons
Class CommonsLogger

java.lang.Object
  extended by mazz.i18n.Logger
      extended by mazz.i18n.commons.CommonsLogger

public class CommonsLogger
extends Logger

Similar in functionality to the CommonsLogMsg utility class, this provides the ability to log messages that are retrieved from a resource bundle with the additional capability of being able to set the base bundle name and locale that this logger will use to log the message. If the locale is not specified or null, the LoggerLocale will be used to determine what locale will be used.

Version:
$Revision: 1.1 $
Author:
John Mazzitelli

Field Summary
 
Fields inherited from class mazz.i18n.Logger
SYSPROP_DUMP_LOG_KEYS, SYSPROP_DUMP_STACK_TRACES
 
Constructor Summary
CommonsLogger(java.lang.Class clazz)
           
CommonsLogger(java.lang.Class clazz, java.util.Locale locale)
           
CommonsLogger(java.lang.Class clazz, Msg.BundleBaseName basename)
           
CommonsLogger(java.lang.Class clazz, Msg.BundleBaseName basename, java.util.Locale locale)
           
CommonsLogger(java.lang.String name)
           
CommonsLogger(java.lang.String name, java.util.Locale locale)
           
CommonsLogger(java.lang.String name, Msg.BundleBaseName basename)
           
CommonsLogger(java.lang.String name, Msg.BundleBaseName basename, java.util.Locale locale)
           
 
Method Summary
protected  void createLogObject(java.lang.Class clazz)
          Creates the Commons-Logging log object.
protected  void createLogObject(java.lang.String name)
          Creates the Commons-Logging log object.
 Msg debug(java.lang.String key, java.lang.Object... varargs)
          Calls CommonsLogMsg.debug(Log, Msg.BundleBaseName, Locale, String, Object[]) to log the message.
 Msg debug(java.lang.Throwable throwable, java.lang.String key, java.lang.Object... varargs)
          Calls CommonsLogMsg.debug(Log, Throwable, Msg.BundleBaseName, Locale, String, Object[]) to log the message.
 Msg error(java.lang.String key, java.lang.Object... varargs)
          Calls CommonsLogMsg.error(Log, Msg.BundleBaseName, Locale, String, Object[]) to log the message.
 Msg error(java.lang.Throwable throwable, java.lang.String key, java.lang.Object... varargs)
          Calls CommonsLogMsg.error(Log, Throwable, Msg.BundleBaseName, Locale, String, Object[]) to log the message.
 Msg fatal(java.lang.String key, java.lang.Object... varargs)
          Calls CommonsLogMsg.fatal(Log, Msg.BundleBaseName, Locale, String, Object[]) to log the message.
 Msg fatal(java.lang.Throwable throwable, java.lang.String key, java.lang.Object... varargs)
          Calls CommonsLogMsg.fatal(Log, Throwable, Msg.BundleBaseName, Locale, String, Object[]) to log the message.
 Msg info(java.lang.String key, java.lang.Object... varargs)
          Calls CommonsLogMsg.info(Log, Msg.BundleBaseName, Locale, String, Object[]) to log the message.
 Msg info(java.lang.Throwable throwable, java.lang.String key, java.lang.Object... varargs)
          Calls CommonsLogMsg.info(Log, Throwable, Msg.BundleBaseName, Locale, String, Object[]) to log the message.
 boolean isDebugEnabled()
          Returns true if the debug log level is enabled
 boolean isErrorEnabled()
          Returns true if the error log level is enabled
 boolean isFatalEnabled()
          Returns true if the fatal log level is enabled
 boolean isInfoEnabled()
          Returns true if the info log level is enabled
 boolean isTraceEnabled()
          Returns true if the trace log level is enabled
 boolean isWarnEnabled()
          Returns true if the warn log level is enabled
 Msg trace(java.lang.String key, java.lang.Object... varargs)
          Calls CommonsLogMsg.trace(Log, Msg.BundleBaseName, Locale, String, Object[]) to log the message.
 Msg trace(java.lang.Throwable throwable, java.lang.String key, java.lang.Object... varargs)
          Calls CommonsLogMsg.trace(Log, Throwable, Msg.BundleBaseName, Locale, String, Object[]) to log the message.
 Msg warn(java.lang.String key, java.lang.Object... varargs)
          Calls CommonsLogMsg.warn(Log, Msg.BundleBaseName, Locale, String, Object[]) to log the message.
 Msg warn(java.lang.Throwable throwable, java.lang.String key, java.lang.Object... varargs)
          Calls CommonsLogMsg.warn(Log, Throwable, Msg.BundleBaseName, Locale, String, Object[]) to log the message.
 
Methods inherited from class mazz.i18n.Logger
getBaseBundleName, getDumpLogKeys, getDumpStackTraces, getLocale, getMsg, getMsgString, setDumpLogKeys, setDumpStackTraces
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommonsLogger

public CommonsLogger(java.lang.String name,
                     Msg.BundleBaseName basename,
                     java.util.Locale locale)
See Also:
Logger.Logger(String, Msg.BundleBaseName, Locale)

CommonsLogger

public CommonsLogger(java.lang.Class clazz,
                     Msg.BundleBaseName basename,
                     java.util.Locale locale)
See Also:
Logger.Logger(Class, Msg.BundleBaseName, Locale)

CommonsLogger

public CommonsLogger(java.lang.String name,
                     Msg.BundleBaseName basename)
See Also:
Logger.Logger(String, Msg.BundleBaseName)

CommonsLogger

public CommonsLogger(java.lang.Class clazz,
                     Msg.BundleBaseName basename)
See Also:
Logger.Logger(Class, Msg.BundleBaseName)

CommonsLogger

public CommonsLogger(java.lang.String name,
                     java.util.Locale locale)
See Also:
Logger.Logger(String, Locale)

CommonsLogger

public CommonsLogger(java.lang.Class clazz,
                     java.util.Locale locale)
See Also:
Logger.Logger(Class, Locale)

CommonsLogger

public CommonsLogger(java.lang.String name)
See Also:
Logger.Logger(String)

CommonsLogger

public CommonsLogger(java.lang.Class clazz)
See Also:
Logger.Logger(Class)
Method Detail

isFatalEnabled

public boolean isFatalEnabled()
Description copied from class: Logger
Returns true if the fatal log level is enabled

Specified by:
isFatalEnabled in class Logger
Returns:
enabled flag
See Also:
Logger.isFatalEnabled()

isErrorEnabled

public boolean isErrorEnabled()
Description copied from class: Logger
Returns true if the error log level is enabled

Specified by:
isErrorEnabled in class Logger
Returns:
enabled flag
See Also:
Logger.isErrorEnabled()

isWarnEnabled

public boolean isWarnEnabled()
Description copied from class: Logger
Returns true if the warn log level is enabled

Specified by:
isWarnEnabled in class Logger
Returns:
enabled flag
See Also:
Logger.isWarnEnabled()

isInfoEnabled

public boolean isInfoEnabled()
Description copied from class: Logger
Returns true if the info log level is enabled

Specified by:
isInfoEnabled in class Logger
Returns:
enabled flag
See Also:
Logger.isInfoEnabled()

isDebugEnabled

public boolean isDebugEnabled()
Description copied from class: Logger
Returns true if the debug log level is enabled

Specified by:
isDebugEnabled in class Logger
Returns:
enabled flag
See Also:
Logger.isDebugEnabled()

isTraceEnabled

public boolean isTraceEnabled()
Description copied from class: Logger
Returns true if the trace log level is enabled

Specified by:
isTraceEnabled in class Logger
Returns:
enabled flag
See Also:
Logger.isTraceEnabled()

fatal

public Msg fatal(java.lang.Throwable throwable,
                 java.lang.String key,
                 java.lang.Object... varargs)
Calls CommonsLogMsg.fatal(Log, Throwable, Msg.BundleBaseName, Locale, String, Object[]) to log the message.

Specified by:
fatal in class Logger
Parameters:
throwable - the throwable to log
key - the resource bundle key of the message to log
varargs - the resource bundle message arguments
Returns:
the resource bundle message that was logged
See Also:
Logger.fatal(Throwable, String, Object[])

fatal

public Msg fatal(java.lang.String key,
                 java.lang.Object... varargs)
Calls CommonsLogMsg.fatal(Log, Msg.BundleBaseName, Locale, String, Object[]) to log the message.

Specified by:
fatal in class Logger
Parameters:
key - the resource bundle key of the message to log
varargs - the resource bundle message arguments
Returns:
the resource bundle message that was logged
See Also:
Logger.fatal(String, Object[])

error

public Msg error(java.lang.Throwable throwable,
                 java.lang.String key,
                 java.lang.Object... varargs)
Calls CommonsLogMsg.error(Log, Throwable, Msg.BundleBaseName, Locale, String, Object[]) to log the message.

Specified by:
error in class Logger
Parameters:
throwable - the throwable to log
key - the resource bundle key of the message to log
varargs - the resource bundle message arguments
Returns:
the resource bundle message that was logged
See Also:
Logger.error(Throwable, String, Object[])

error

public Msg error(java.lang.String key,
                 java.lang.Object... varargs)
Calls CommonsLogMsg.error(Log, Msg.BundleBaseName, Locale, String, Object[]) to log the message.

Specified by:
error in class Logger
Parameters:
key - the resource bundle key of the message to log
varargs - the resource bundle message arguments
Returns:
the resource bundle message that was logged
See Also:
Logger.error(String, Object[])

warn

public Msg warn(java.lang.Throwable throwable,
                java.lang.String key,
                java.lang.Object... varargs)
Calls CommonsLogMsg.warn(Log, Throwable, Msg.BundleBaseName, Locale, String, Object[]) to log the message.

Specified by:
warn in class Logger
Parameters:
throwable - the throwable to log
key - the resource bundle key of the message to log
varargs - the resource bundle message arguments
Returns:
the resource bundle message that was logged
See Also:
Logger.warn(Throwable, String, Object[])

warn

public Msg warn(java.lang.String key,
                java.lang.Object... varargs)
Calls CommonsLogMsg.warn(Log, Msg.BundleBaseName, Locale, String, Object[]) to log the message.

Specified by:
warn in class Logger
Parameters:
key - the resource bundle key of the message to log
varargs - the resource bundle message arguments
Returns:
the resource bundle message that was logged
See Also:
Logger.warn(String, Object[])

info

public Msg info(java.lang.Throwable throwable,
                java.lang.String key,
                java.lang.Object... varargs)
Calls CommonsLogMsg.info(Log, Throwable, Msg.BundleBaseName, Locale, String, Object[]) to log the message.

Specified by:
info in class Logger
Parameters:
throwable - the throwable to log
key - the resource bundle key of the message to log
varargs - the resource bundle message arguments
Returns:
the resource bundle message that was logged
See Also:
Logger.info(Throwable, String, Object[])

info

public Msg info(java.lang.String key,
                java.lang.Object... varargs)
Calls CommonsLogMsg.info(Log, Msg.BundleBaseName, Locale, String, Object[]) to log the message.

Specified by:
info in class Logger
Parameters:
key - the resource bundle key of the message to log
varargs - the resource bundle message arguments
Returns:
the resource bundle message that was logged
See Also:
Logger.info(String, Object[])

debug

public Msg debug(java.lang.Throwable throwable,
                 java.lang.String key,
                 java.lang.Object... varargs)
Calls CommonsLogMsg.debug(Log, Throwable, Msg.BundleBaseName, Locale, String, Object[]) to log the message.

Specified by:
debug in class Logger
Parameters:
throwable - the throwable to log
key - the resource bundle key of the message to log
varargs - the resource bundle message arguments
Returns:
the resource bundle message that was logged
See Also:
Logger.debug(Throwable, String, Object[])

debug

public Msg debug(java.lang.String key,
                 java.lang.Object... varargs)
Calls CommonsLogMsg.debug(Log, Msg.BundleBaseName, Locale, String, Object[]) to log the message.

Specified by:
debug in class Logger
Parameters:
key - the resource bundle key of the message to log
varargs - the resource bundle message arguments
Returns:
the resource bundle message that was logged
See Also:
Logger.debug(String, Object[])

trace

public Msg trace(java.lang.Throwable throwable,
                 java.lang.String key,
                 java.lang.Object... varargs)
Calls CommonsLogMsg.trace(Log, Throwable, Msg.BundleBaseName, Locale, String, Object[]) to log the message.

Specified by:
trace in class Logger
Parameters:
throwable - the throwable to log
key - the resource bundle key of the message to log
varargs - the resource bundle message arguments
Returns:
the resource bundle message that was logged
See Also:
Logger.trace(Throwable, String, Object[])

trace

public Msg trace(java.lang.String key,
                 java.lang.Object... varargs)
Calls CommonsLogMsg.trace(Log, Msg.BundleBaseName, Locale, String, Object[]) to log the message.

Specified by:
trace in class Logger
Parameters:
key - the resource bundle key of the message to log
varargs - the resource bundle message arguments
Returns:
the resource bundle message that was logged
See Also:
Logger.trace(String, Object[])

createLogObject

protected void createLogObject(java.lang.Class clazz)
Creates the Commons-Logging log object.

Specified by:
createLogObject in class Logger
Parameters:
clazz - the class to associate with the log object that is to be created
See Also:
Logger.createLogObject(Class)

createLogObject

protected void createLogObject(java.lang.String name)
Creates the Commons-Logging log object.

Specified by:
createLogObject in class Logger
Parameters:
name - the name to associate with the log object that is to be created
See Also:
Logger.createLogObject(String)


Copyright © 2006 John J. Mazzitelli All Rights Reserved. Licensed under LGPL