barcode4j 2.1.0

org.krysalis.barcode4j.cli
Class AdvancedConsoleLogger

java.lang.Object
  extended by org.krysalis.barcode4j.cli.AdvancedConsoleLogger
All Implemented Interfaces:
org.apache.avalon.framework.logger.Logger

public class AdvancedConsoleLogger
extends java.lang.Object
implements org.apache.avalon.framework.logger.Logger

Special Logger implementation that can split output between stdout and stderr based on the log level and can omit the log level prefix.

Version:
$Id: AdvancedConsoleLogger.java,v 1.2 2004/09/04 20:25:58 jmaerki Exp $
Author:
Jeremias Maerki

Field Summary
static int LEVEL_DEBUG
          Log level: debug
static int LEVEL_DISABLED
          Log level: disabled
static int LEVEL_ERROR
          Log level: errors
static int LEVEL_FATAL
          Log level: fatal errors
static int LEVEL_INFO
          Log level: info
static int LEVEL_WARN
          Log level: warnings
 
Constructor Summary
AdvancedConsoleLogger()
          Default constructor.
AdvancedConsoleLogger(int logLevel, boolean prefix, java.io.PrintStream out, java.io.PrintStream err)
          Constructor will full configurability.
 
Method Summary
 void debug(java.lang.String msg)
           
 void debug(java.lang.String msg, java.lang.Throwable t)
           
 void error(java.lang.String msg)
           
 void error(java.lang.String msg, java.lang.Throwable t)
           
 void fatalError(java.lang.String msg)
           
 void fatalError(java.lang.String msg, java.lang.Throwable t)
           
 org.apache.avalon.framework.logger.Logger getChildLogger(java.lang.String name)
           
 void info(java.lang.String msg)
           
 void info(java.lang.String msg, java.lang.Throwable t)
           
 boolean isDebugEnabled()
           
 boolean isErrorEnabled()
           
 boolean isFatalErrorEnabled()
           
 boolean isInfoEnabled()
           
 boolean isWarnEnabled()
           
 void warn(java.lang.String msg)
           
 void warn(java.lang.String msg, java.lang.Throwable t)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEVEL_DEBUG

public static final int LEVEL_DEBUG
Log level: debug

See Also:
Constant Field Values

LEVEL_INFO

public static final int LEVEL_INFO
Log level: info

See Also:
Constant Field Values

LEVEL_WARN

public static final int LEVEL_WARN
Log level: warnings

See Also:
Constant Field Values

LEVEL_ERROR

public static final int LEVEL_ERROR
Log level: errors

See Also:
Constant Field Values

LEVEL_FATAL

public static final int LEVEL_FATAL
Log level: fatal errors

See Also:
Constant Field Values

LEVEL_DISABLED

public static final int LEVEL_DISABLED
Log level: disabled

See Also:
Constant Field Values
Constructor Detail

AdvancedConsoleLogger

public AdvancedConsoleLogger(int logLevel,
                             boolean prefix,
                             java.io.PrintStream out,
                             java.io.PrintStream err)
Constructor will full configurability.

Parameters:
logLevel - One of the AdvancedConsoleLogger.LEVEL_* constants.
prefix - false disables "[DEBUG] ", "[INFO] " prefixes
out - PrintStream to use for stdout/System.out
err - PrintStream to use for stderr/System.err

AdvancedConsoleLogger

public AdvancedConsoleLogger()
Default constructor. Same behaviour as Avalon's ConsoleLogger.

Method Detail

debug

public void debug(java.lang.String msg)
Specified by:
debug in interface org.apache.avalon.framework.logger.Logger
See Also:
Logger.debug(String)

debug

public void debug(java.lang.String msg,
                  java.lang.Throwable t)
Specified by:
debug in interface org.apache.avalon.framework.logger.Logger
See Also:
Logger.debug(String, Throwable)

isDebugEnabled

public boolean isDebugEnabled()
Specified by:
isDebugEnabled in interface org.apache.avalon.framework.logger.Logger
See Also:
Logger.isDebugEnabled()

info

public void info(java.lang.String msg)
Specified by:
info in interface org.apache.avalon.framework.logger.Logger
See Also:
Logger.info(String)

info

public void info(java.lang.String msg,
                 java.lang.Throwable t)
Specified by:
info in interface org.apache.avalon.framework.logger.Logger
See Also:
Logger.info(String, Throwable)

isInfoEnabled

public boolean isInfoEnabled()
Specified by:
isInfoEnabled in interface org.apache.avalon.framework.logger.Logger
See Also:
Logger.isInfoEnabled()

warn

public void warn(java.lang.String msg)
Specified by:
warn in interface org.apache.avalon.framework.logger.Logger
See Also:
Logger.warn(String)

warn

public void warn(java.lang.String msg,
                 java.lang.Throwable t)
Specified by:
warn in interface org.apache.avalon.framework.logger.Logger
See Also:
Logger.warn(String, Throwable)

isWarnEnabled

public boolean isWarnEnabled()
Specified by:
isWarnEnabled in interface org.apache.avalon.framework.logger.Logger
See Also:
Logger.isWarnEnabled()

error

public void error(java.lang.String msg)
Specified by:
error in interface org.apache.avalon.framework.logger.Logger
See Also:
Logger.error(String)

error

public void error(java.lang.String msg,
                  java.lang.Throwable t)
Specified by:
error in interface org.apache.avalon.framework.logger.Logger
See Also:
Logger.error(String, Throwable)

isErrorEnabled

public boolean isErrorEnabled()
Specified by:
isErrorEnabled in interface org.apache.avalon.framework.logger.Logger
See Also:
Logger.isErrorEnabled()

fatalError

public void fatalError(java.lang.String msg)
Specified by:
fatalError in interface org.apache.avalon.framework.logger.Logger
See Also:
Logger.fatalError(String)

fatalError

public void fatalError(java.lang.String msg,
                       java.lang.Throwable t)
Specified by:
fatalError in interface org.apache.avalon.framework.logger.Logger
See Also:
Logger.fatalError(String, Throwable)

isFatalErrorEnabled

public boolean isFatalErrorEnabled()
Specified by:
isFatalErrorEnabled in interface org.apache.avalon.framework.logger.Logger
See Also:
Logger.isFatalErrorEnabled()

getChildLogger

public org.apache.avalon.framework.logger.Logger getChildLogger(java.lang.String name)
Specified by:
getChildLogger in interface org.apache.avalon.framework.logger.Logger
See Also:
Logger.getChildLogger(String)

barcode4j 2.1.0

Copyright © 2000-2010 Jeremias Maerki. All rights reserved.