Package org.apache.ivy.util
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 TypeMethodDescriptionvoid
Clears the list of problems, warns and errors.void
void
deprecated
(String msg) void
void
endProgress
(String msg) void
getWarns()
void
boolean
void
Logs a message at the given level.Returns the current logger, or the default one if there is no logger in the stackvoid
Pops a logger from the logger stack.void
progress()
void
pushLogger
(MessageLogger logger) Push a logger on the stack.void
void
Same asMessageLogger.log(String, int)
, but without adding any contextual information to the message.void
setDefaultLogger
(MessageLogger defaultLogger) Sets the logger used when the stack is empty.void
setShowProgress
(boolean progress) void
Sumup all problems encountered so far, and clear them.void
void
-
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:
warn
in interfaceMessageLogger
-
error
- Specified by:
error
in interfaceMessageLogger
-
getErrors
- Specified by:
getErrors
in interfaceMessageLogger
-
getProblems
- Specified by:
getProblems
in interfaceMessageLogger
-
getWarns
- Specified by:
getWarns
in interfaceMessageLogger
-
sumupProblems
public void sumupProblems()Description copied from interface:MessageLogger
Sumup all problems encountered so far, and clear them.- Specified by:
sumupProblems
in interfaceMessageLogger
-
clearProblems
public void clearProblems()Description copied from interface:MessageLogger
Clears the list of problems, warns and errors.- Specified by:
clearProblems
in interfaceMessageLogger
-
setShowProgress
public void setShowProgress(boolean progress) - Specified by:
setShowProgress
in interfaceMessageLogger
-
isShowProgress
public boolean isShowProgress()- Specified by:
isShowProgress
in interfaceMessageLogger
-
debug
- Specified by:
debug
in interfaceMessageLogger
-
deprecated
- Specified by:
deprecated
in interfaceMessageLogger
-
endProgress
public void endProgress()- Specified by:
endProgress
in interfaceMessageLogger
-
endProgress
- Specified by:
endProgress
in interfaceMessageLogger
-
info
- Specified by:
info
in interfaceMessageLogger
-
rawinfo
- Specified by:
rawinfo
in interfaceMessageLogger
-
log
Description copied from interface:MessageLogger
Logs a message at the given level.level
constants are defined in theMessage
class.- Specified by:
log
in interfaceMessageLogger
- Parameters:
msg
- the message to loglevel
- the level at which the message should be logged.- See Also:
-
progress
public void progress()- Specified by:
progress
in interfaceMessageLogger
-
rawlog
Description copied from interface:MessageLogger
Same asMessageLogger.log(String, int)
, but without adding any contextual information to the message.- Specified by:
rawlog
in interfaceMessageLogger
- Parameters:
msg
- the message to loglevel
- the level at which the message should be logged.
-
verbose
- Specified by:
verbose
in interfaceMessageLogger
-