org.apache.ivy.util

## Class MessageLoggerEngine

- java.lang.Object
- - org.apache.ivy.util.MessageLoggerEngine

- All Implemented Interfaces:
    MessageLogger

      public class MessageLoggerEngine
      extends java.lang.Object
      implements 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
    Constructor and Description
    `MessageLoggerEngine()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clearProblems()` Clears the list of problems, warns and errors.
    `void` | `debug(java.lang.String msg)`
    `void` | `deprecated(java.lang.String msg)`
    `void` | `endProgress()`
    `void` | `endProgress(java.lang.String msg)`
    `void` | `error(java.lang.String msg)`
    `java.util.List` | `getErrors()`
    `java.util.List` | `getProblems()`
    `java.util.List` | `getWarns()`
    `void` | `info(java.lang.String msg)`
    `boolean` | `isShowProgress()`
    `void` | `log(java.lang.String msg, int level)` Logs a message at the given level.
    `MessageLogger` | `peekLogger()` Returns the current logger, or the default one if there is no logger in the stack
    `void` | `popLogger()` Pops a logger from the logger stack.
    `void` | `progress()`
    `void` | `pushLogger(MessageLogger logger)` Push a logger on the stack.
    `void` | `rawinfo(java.lang.String msg)`
    `void` | `rawlog(java.lang.String msg, int level)` Same as `MessageLogger.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` | `sumupProblems()` Sumup all problems encountered so far, and clear them.
    `void` | `verbose(java.lang.String msg)`
    `void` | `warn(java.lang.String msg)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MessageLoggerEngine

          public MessageLoggerEngine()

  - ### Method Detail

    - #### setDefaultLogger

          public void setDefaultLogger(MessageLogger defaultLogger)

      Sets the logger used when the stack is empty.
      Parameters:
        `defaultLogger` - the logger to use when the stack is empty.

    - #### pushLogger

          public void pushLogger(MessageLogger logger)

      Push a logger on the stack.
      Parameters:
        `logger` - the logger to push. Must not be `null`.

    - #### popLogger

          public void popLogger()

      Pops a logger from the logger stack.

      Does nothing if the logger stack is empty

    - #### peekLogger

          public MessageLogger 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

          public void warn(java.lang.String msg)

      Specified by:
        `warn` in interface `MessageLogger`

    - #### error

          public void error(java.lang.String msg)

      Specified by:
        `error` in interface `MessageLogger`

    - #### getErrors

          public java.util.List getErrors()

      Specified by:
        `getErrors` in interface `MessageLogger`

    - #### getProblems

          public java.util.List getProblems()

      Specified by:
        `getProblems` in interface `MessageLogger`

    - #### getWarns

          public java.util.List getWarns()

      Specified by:
        `getWarns` in interface `MessageLogger`

    - #### sumupProblems

          public void sumupProblems()

      Description copied from interface: `MessageLogger`
      Sumup all problems encountered so far, and clear them.
      Specified by:
        `sumupProblems` in interface `MessageLogger`

    - #### clearProblems

          public void clearProblems()

      Description copied from interface: `MessageLogger`
      Clears the list of problems, warns and errors.
      Specified by:
        `clearProblems` in interface `MessageLogger`

    - #### setShowProgress

          public void setShowProgress(boolean progress)

      Specified by:
        `setShowProgress` in interface `MessageLogger`

    - #### isShowProgress

          public boolean isShowProgress()

      Specified by:
        `isShowProgress` in interface `MessageLogger`

    - #### debug

          public void debug(java.lang.String msg)

      Specified by:
        `debug` in interface `MessageLogger`

    - #### deprecated

          public void deprecated(java.lang.String msg)

      Specified by:
        `deprecated` in interface `MessageLogger`

    - #### endProgress

          public void endProgress()

      Specified by:
        `endProgress` in interface `MessageLogger`

    - #### endProgress

          public void endProgress(java.lang.String msg)

      Specified by:
        `endProgress` in interface `MessageLogger`

    - #### info

          public void info(java.lang.String msg)

      Specified by:
        `info` in interface `MessageLogger`

    - #### rawinfo

          public void rawinfo(java.lang.String msg)

      Specified by:
        `rawinfo` in interface `MessageLogger`

    - #### log

          public void log(java.lang.String msg,
                 int level)

      Description copied from interface: `MessageLogger`
      Logs a message at the given level.

      `level` constants are defined in the `Message` class.

      Specified by:
        `log` in interface `MessageLogger`
      Parameters:
        `msg` - the message to log
        `level` - the level at which the message should be logged.
      See Also:
        `Message.MSG_DEBUG`, `Message.MSG_VERBOSE`, `Message.MSG_INFO`, `Message.MSG_WARN`, `Message#MSG_ERROR`

    - #### progress

          public void progress()

      Specified by:
        `progress` in interface `MessageLogger`

    - #### rawlog

          public void rawlog(java.lang.String msg,
                    int level)

      Description copied from interface: `MessageLogger`
      Same as `MessageLogger.log(String, int)`, but without adding any contextual information to the message.
      Specified by:
        `rawlog` in interface `MessageLogger`
      Parameters:
        `msg` - the message to log
        `level` - the level at which the message should be logged.

    - #### verbose

          public void verbose(java.lang.String msg)

      Specified by:
        `verbose` in interface `MessageLogger`