Class MessageLoggerEngine
java.lang.Object
org.apache.ivy.util.MessageLoggerEngine
- All Implemented Interfaces:
MessageLogger
A
MessageLogger implementation delegating the work to the current top logger on a stack.
When the logger stack is empty, it delegates the work to a default logger, which by default is
the Message.getDefaultLogger().
pushLogger(MessageLogger) should be called to delegate to a new logger, and
popLogger() should be called when the context of this logger is finished.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClears the list of problems, warns and errors.voidvoiddeprecated(String msg) voidvoidendProgress(String msg) voidgetWarns()voidbooleanvoidLogs a message at the given level.Returns the current logger, or the default one if there is no logger in the stackvoidPops a logger from the logger stack.voidprogress()voidpushLogger(MessageLogger logger) Push a logger on the stack.voidvoidSame asMessageLogger.log(String, int), but without adding any contextual information to the message.voidsetDefaultLogger(MessageLogger defaultLogger) Sets the logger used when the stack is empty.voidsetShowProgress(boolean progress) voidSumup all problems encountered so far, and clear them.voidvoid
-
Constructor Details
-
MessageLoggerEngine
public MessageLoggerEngine()
-
-
Method Details
-
setDefaultLogger
Sets the logger used when the stack is empty.- Parameters:
defaultLogger- the logger to use when the stack is empty.
-
pushLogger
Push a logger on the stack.- Parameters:
logger- the logger to push. Must not benull.
-
popLogger
public void popLogger()Pops a logger from the logger stack.Does nothing if the logger stack is empty
-
peekLogger
Returns the current logger, or the default one if there is no logger in the stack- Returns:
- the current logger, or the default one if there is no logger in the stack
-
warn
- Specified by:
warnin interfaceMessageLogger
-
error
- Specified by:
errorin interfaceMessageLogger
-
getErrors
- Specified by:
getErrorsin interfaceMessageLogger
-
getProblems
- Specified by:
getProblemsin interfaceMessageLogger
-
getWarns
- Specified by:
getWarnsin interfaceMessageLogger
-
sumupProblems
public void sumupProblems()Description copied from interface:MessageLoggerSumup all problems encountered so far, and clear them.- Specified by:
sumupProblemsin interfaceMessageLogger
-
clearProblems
public void clearProblems()Description copied from interface:MessageLoggerClears the list of problems, warns and errors.- Specified by:
clearProblemsin interfaceMessageLogger
-
setShowProgress
public void setShowProgress(boolean progress) - Specified by:
setShowProgressin interfaceMessageLogger
-
isShowProgress
public boolean isShowProgress()- Specified by:
isShowProgressin interfaceMessageLogger
-
debug
- Specified by:
debugin interfaceMessageLogger
-
deprecated
- Specified by:
deprecatedin interfaceMessageLogger
-
endProgress
public void endProgress()- Specified by:
endProgressin interfaceMessageLogger
-
endProgress
- Specified by:
endProgressin interfaceMessageLogger
-
info
- Specified by:
infoin interfaceMessageLogger
-
rawinfo
- Specified by:
rawinfoin interfaceMessageLogger
-
log
Description copied from interface:MessageLoggerLogs a message at the given level.levelconstants are defined in theMessageclass.- Specified by:
login interfaceMessageLogger- Parameters:
msg- the message to loglevel- the level at which the message should be logged.- See Also:
-
progress
public void progress()- Specified by:
progressin interfaceMessageLogger
-
rawlog
Description copied from interface:MessageLoggerSame asMessageLogger.log(String, int), but without adding any contextual information to the message.- Specified by:
rawlogin interfaceMessageLogger- Parameters:
msg- the message to loglevel- the level at which the message should be logged.
-
verbose
- Specified by:
verbosein interfaceMessageLogger
-