org.apache.maven.shared.invoker
Class PrintStreamLogger

java.lang.Object
  extended by org.apache.maven.shared.invoker.PrintStreamLogger
All Implemented Interfaces:
InvokerLogger
Direct Known Subclasses:
SystemOutLogger

public class PrintStreamLogger
extends Object
implements InvokerLogger

Offers a logger that writes to a print stream like System.out.

Since:
2.0.9
Version:
$Id: PrintStreamLogger.java 661996 2008-05-31 10:50:38Z bentmann $

Field Summary
 
Fields inherited from interface org.apache.maven.shared.invoker.InvokerLogger
DEBUG, ERROR, FATAL, INFO, WARN
 
Constructor Summary
PrintStreamLogger()
          Creates a new logger that writes to System.out and has a threshold of InvokerLogger.INFO.
PrintStreamLogger(PrintStream out, int threshold)
          Creates a new logger that writes to the specified print stream.
 
Method Summary
 void debug(String message)
          Logs the specified debug message.
 void debug(String message, Throwable throwable)
          Logs the specified debug message and the accompanying exception.
 void error(String message)
          Logs the specified error message.
 void error(String message, Throwable throwable)
          Logs the specified error message and the accompanying exception.
 void fatalError(String message)
          Logs the specified fatal error message.
 void fatalError(String message, Throwable throwable)
          Logs the specified fatal error message and the accompanying exception.
 int getThreshold()
          Gets the logger's threshold.
 void info(String message)
          Logs the specified info message.
 void info(String message, Throwable throwable)
          Logs the specified info message and the accompanying exception.
 boolean isDebugEnabled()
          Tests whether debug output is enabled for this logger.
 boolean isErrorEnabled()
          Tests whether error output is enabled for this logger.
 boolean isFatalErrorEnabled()
          Tests whether fatal error output is enabled for this logger.
 boolean isInfoEnabled()
          Tests whether info output is enabled for this logger.
 boolean isWarnEnabled()
          Tests whether warn output is enabled for this logger.
 void setThreshold(int threshold)
          Sets the logger's threshold.
 void warn(String message)
          Logs the specified warning message.
 void warn(String message, Throwable throwable)
          Logs the specified warning message and the accompanying exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrintStreamLogger

public PrintStreamLogger()
Creates a new logger that writes to System.out and has a threshold of InvokerLogger.INFO.


PrintStreamLogger

public PrintStreamLogger(PrintStream out,
                         int threshold)
Creates a new logger that writes to the specified print stream.

Parameters:
out - The print stream to write to, must not be null.
threshold - The threshold for the logger.
Method Detail

debug

public void debug(String message)
Description copied from interface: InvokerLogger
Logs the specified debug message.

Specified by:
debug in interface InvokerLogger
Parameters:
message - The message to log, may be null.

debug

public void debug(String message,
                  Throwable throwable)
Description copied from interface: InvokerLogger
Logs the specified debug message and the accompanying exception.

Specified by:
debug in interface InvokerLogger
Parameters:
message - The message to log, may be null.
throwable - The exception to log, may be null.

info

public void info(String message)
Description copied from interface: InvokerLogger
Logs the specified info message.

Specified by:
info in interface InvokerLogger
Parameters:
message - The message to log, may be null.

info

public void info(String message,
                 Throwable throwable)
Description copied from interface: InvokerLogger
Logs the specified info message and the accompanying exception.

Specified by:
info in interface InvokerLogger
Parameters:
message - The message to log, may be null.
throwable - The exception to log, may be null.

warn

public void warn(String message)
Description copied from interface: InvokerLogger
Logs the specified warning message.

Specified by:
warn in interface InvokerLogger
Parameters:
message - The message to log, may be null.

warn

public void warn(String message,
                 Throwable throwable)
Description copied from interface: InvokerLogger
Logs the specified warning message and the accompanying exception.

Specified by:
warn in interface InvokerLogger
Parameters:
message - The message to log, may be null.
throwable - The exception to log, may be null.

error

public void error(String message)
Description copied from interface: InvokerLogger
Logs the specified error message.

Specified by:
error in interface InvokerLogger
Parameters:
message - The message to log, may be null.

error

public void error(String message,
                  Throwable throwable)
Description copied from interface: InvokerLogger
Logs the specified error message and the accompanying exception.

Specified by:
error in interface InvokerLogger
Parameters:
message - The message to log, may be null.
throwable - The exception to log, may be null.

fatalError

public void fatalError(String message)
Description copied from interface: InvokerLogger
Logs the specified fatal error message.

Specified by:
fatalError in interface InvokerLogger
Parameters:
message - The message to log, may be null.

fatalError

public void fatalError(String message,
                       Throwable throwable)
Description copied from interface: InvokerLogger
Logs the specified fatal error message and the accompanying exception.

Specified by:
fatalError in interface InvokerLogger
Parameters:
message - The message to log, may be null.
throwable - The exception to log, may be null.

isDebugEnabled

public boolean isDebugEnabled()
Description copied from interface: InvokerLogger
Tests whether debug output is enabled for this logger.

Specified by:
isDebugEnabled in interface InvokerLogger
Returns:
true if messages with priority "debug" or above are logged, false otherwise.

isErrorEnabled

public boolean isErrorEnabled()
Description copied from interface: InvokerLogger
Tests whether error output is enabled for this logger.

Specified by:
isErrorEnabled in interface InvokerLogger
Returns:
true if messages with priority "error" or above are logged, false otherwise.

isFatalErrorEnabled

public boolean isFatalErrorEnabled()
Description copied from interface: InvokerLogger
Tests whether fatal error output is enabled for this logger.

Specified by:
isFatalErrorEnabled in interface InvokerLogger
Returns:
true if messages with priority "fatal" or above are logged, false otherwise.

isInfoEnabled

public boolean isInfoEnabled()
Description copied from interface: InvokerLogger
Tests whether info output is enabled for this logger.

Specified by:
isInfoEnabled in interface InvokerLogger
Returns:
true if messages with priority "info" or above are logged, false otherwise.

isWarnEnabled

public boolean isWarnEnabled()
Description copied from interface: InvokerLogger
Tests whether warn output is enabled for this logger.

Specified by:
isWarnEnabled in interface InvokerLogger
Returns:
true if messages with priority "warn" or above are logged, false otherwise.

getThreshold

public int getThreshold()
Description copied from interface: InvokerLogger
Gets the logger's threshold.

Specified by:
getThreshold in interface InvokerLogger
Returns:
The logger's threshold, one of InvokerLogger.DEBUG, InvokerLogger.INFO, InvokerLogger.WARN, InvokerLogger.ERROR and InvokerLogger.FATAL.

setThreshold

public void setThreshold(int threshold)
Description copied from interface: InvokerLogger
Sets the logger's threshold.

Specified by:
setThreshold in interface InvokerLogger
Parameters:
threshold - The logger's threshold, must be one of InvokerLogger.DEBUG, InvokerLogger.INFO, InvokerLogger.WARN, InvokerLogger.ERROR and InvokerLogger.FATAL.


Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.