Package org.codehaus.mojo.jaxb2
Class BufferingLog
- java.lang.Object
-
- org.codehaus.mojo.jaxb2.BufferingLog
-
- All Implemented Interfaces:
org.apache.maven.plugin.logging.Log
public class BufferingLog extends Object implements org.apache.maven.plugin.logging.Log
Trivial Maven Log implementation which stores all logged messages within a SortedMap for later retrieval.- Author:
- Lennart Jörelid, jGuru Europe AB
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BufferingLog.LogLevel
-
Constructor Summary
Constructors Constructor Description BufferingLog()
BufferingLog(BufferingLog.LogLevel minLevel)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
debug(CharSequence content)
void
debug(CharSequence content, Throwable error)
void
debug(Throwable error)
void
error(CharSequence content)
void
error(CharSequence content, Throwable error)
void
error(Throwable error)
SortedMap<String,Throwable>
getAndResetLogBuffer()
Retrieves the current LogBuffer, and resets the internal state of this BufferingLog.SortedMap<String,Throwable>
getLogBuffer()
BufferingLog.LogLevel
getMinimumLogLevel()
String
getPrettyPrintedLog()
void
info(CharSequence content)
void
info(CharSequence content, Throwable error)
void
info(Throwable error)
boolean
isDebugEnabled()
boolean
isErrorEnabled()
boolean
isInfoEnabled()
boolean
isWarnEnabled()
static void
setMinimumIntegerDigits(int minimumIntegerDigits)
Assigns the minimum number of Integer digits in the Log format.void
warn(CharSequence content)
void
warn(CharSequence content, Throwable error)
void
warn(Throwable error)
-
-
-
Constructor Detail
-
BufferingLog
public BufferingLog()
-
BufferingLog
public BufferingLog(BufferingLog.LogLevel minLevel)
-
-
Method Detail
-
getMinimumLogLevel
public BufferingLog.LogLevel getMinimumLogLevel()
- Returns:
- The minimum LogLevel for which this BufferingLog will record log events.
-
getLogBuffer
public SortedMap<String,Throwable> getLogBuffer()
- Returns:
- The LogBuffer holding all log messages, and their corresponding (optional) Throwable.
-
getAndResetLogBuffer
public SortedMap<String,Throwable> getAndResetLogBuffer()
Retrieves the current LogBuffer, and resets the internal state of this BufferingLog.- Returns:
- The LogBuffer holding all log messages, and their corresponding (optional) Throwable.
-
setMinimumIntegerDigits
public static void setMinimumIntegerDigits(int minimumIntegerDigits)
Assigns the minimum number of Integer digits in the Log format.- Parameters:
minimumIntegerDigits
- the minimum number of Integer digits in the Log format.
-
getPrettyPrintedLog
public String getPrettyPrintedLog()
- Returns:
- A Pretty-printed version of the log buffer.
-
debug
public void debug(CharSequence content, Throwable error)
- Specified by:
debug
in interfaceorg.apache.maven.plugin.logging.Log
-
debug
public void debug(CharSequence content)
- Specified by:
debug
in interfaceorg.apache.maven.plugin.logging.Log
-
debug
public void debug(Throwable error)
- Specified by:
debug
in interfaceorg.apache.maven.plugin.logging.Log
-
info
public void info(CharSequence content, Throwable error)
- Specified by:
info
in interfaceorg.apache.maven.plugin.logging.Log
-
info
public void info(CharSequence content)
- Specified by:
info
in interfaceorg.apache.maven.plugin.logging.Log
-
info
public void info(Throwable error)
- Specified by:
info
in interfaceorg.apache.maven.plugin.logging.Log
-
warn
public void warn(CharSequence content, Throwable error)
- Specified by:
warn
in interfaceorg.apache.maven.plugin.logging.Log
-
warn
public void warn(CharSequence content)
- Specified by:
warn
in interfaceorg.apache.maven.plugin.logging.Log
-
warn
public void warn(Throwable error)
- Specified by:
warn
in interfaceorg.apache.maven.plugin.logging.Log
-
error
public void error(CharSequence content, Throwable error)
- Specified by:
error
in interfaceorg.apache.maven.plugin.logging.Log
-
error
public void error(CharSequence content)
- Specified by:
error
in interfaceorg.apache.maven.plugin.logging.Log
-
error
public void error(Throwable error)
- Specified by:
error
in interfaceorg.apache.maven.plugin.logging.Log
-
isDebugEnabled
public boolean isDebugEnabled()
- Specified by:
isDebugEnabled
in interfaceorg.apache.maven.plugin.logging.Log
-
isInfoEnabled
public boolean isInfoEnabled()
- Specified by:
isInfoEnabled
in interfaceorg.apache.maven.plugin.logging.Log
-
isWarnEnabled
public boolean isWarnEnabled()
- Specified by:
isWarnEnabled
in interfaceorg.apache.maven.plugin.logging.Log
-
isErrorEnabled
public boolean isErrorEnabled()
- Specified by:
isErrorEnabled
in interfaceorg.apache.maven.plugin.logging.Log
-
-