Class DefaultLog

java.lang.Object
org.apache.maven.internal.impl.DefaultLog
All Implemented Interfaces:
Log

public class DefaultLog extends Object implements Log
  • Constructor Details

    • DefaultLog

      public DefaultLog(org.slf4j.Logger logger)
  • Method Details

    • isTraceEnabled

      public boolean isTraceEnabled()
      Description copied from interface: Log
      Returns true if the trace error level is enabled.

      The default implementation returns false for backward compatibility with existing Log implementations.

      Specified by:
      isTraceEnabled in interface Log
      Returns:
      true if the trace error level is enabled
    • trace

      public void trace(CharSequence content)
      Description copied from interface: Log
      Sends a message to the user in the trace error level.

      Trace is the most verbose level, intended for Maven core internals such as resolver negotiation, model interpolation, and lifecycle ordering details. Use Log.debug(CharSequence) instead for messages that help users investigate their build (e.g. why a module was recompiled).

      The default implementation is a no-op for backward compatibility.

      Specified by:
      trace in interface Log
      Parameters:
      content - the message to log
    • trace

      public void trace(CharSequence content, Throwable error)
      Description copied from interface: Log
      Sends a message (and accompanying exception) to the user at the trace error level. The error's stacktrace will be output when this error level is enabled.

      The default implementation is a no-op for backward compatibility.

      Specified by:
      trace in interface Log
      Parameters:
      content - the message to log
      error - the error that caused this log
    • trace

      public void trace(Throwable error)
      Description copied from interface: Log
      Sends an exception to the user in the trace error level. The stack trace for this exception will be output when this error level is enabled.

      The default implementation is a no-op for backward compatibility.

      Specified by:
      trace in interface Log
      Parameters:
      error - the error that caused this log
    • trace

      public void trace(Supplier<String> content)
      Description copied from interface: Log
      Sends a lazily-computed message in the trace error level. The supplier is only evaluated if trace is enabled.

      The default implementation is a no-op for backward compatibility.

      Specified by:
      trace in interface Log
      Parameters:
      content - the message supplier
    • trace

      public void trace(Supplier<String> content, Throwable error)
      Description copied from interface: Log
      Sends a lazily-computed message (and accompanying exception) in the trace error level. The supplier is only evaluated if trace is enabled.

      The default implementation is a no-op for backward compatibility.

      Specified by:
      trace in interface Log
      Parameters:
      content - the message supplier
      error - the error that caused this log
    • debug

      public void debug(CharSequence content)
      Description copied from interface: Log
      Sends a message to the user in the debug error level.

      Debug is intended for messages that help users investigate their build — for example, why a module was recompiled or what classpath was resolved. For Maven core internals, use Log.trace(CharSequence) instead.

      Specified by:
      debug in interface Log
      Parameters:
      content - the message to log
    • debug

      public void debug(CharSequence content, Throwable error)
      Description copied from interface: Log
      Sends a message (and accompanying exception) to the user in the debug error level. The error's stacktrace will be output when this error level is enabled.
      Specified by:
      debug in interface Log
      Parameters:
      content - the message to log
      error - the error that caused this log
    • debug

      public void debug(Throwable error)
      Description copied from interface: Log
      Sends an exception to the user in the debug error level. The stack trace for this exception will be output when this error level is enabled.
      Specified by:
      debug in interface Log
      Parameters:
      error - the error that caused this log
    • debug

      public void debug(Supplier<String> content)
      Specified by:
      debug in interface Log
    • debug

      public void debug(Supplier<String> content, Throwable error)
      Specified by:
      debug in interface Log
    • info

      public void info(CharSequence content)
      Description copied from interface: Log
      Sends a message to the user in the info error level.
      Specified by:
      info in interface Log
      Parameters:
      content - the message to log
    • info

      public void info(CharSequence content, Throwable error)
      Description copied from interface: Log
      Sends a message (and accompanying exception) to the user in the info error level. The error's stacktrace will be output when this error level is enabled.
      Specified by:
      info in interface Log
      Parameters:
      content - the message to log
      error - the error that caused this log
    • info

      public void info(Throwable error)
      Description copied from interface: Log
      Sends an exception to the user in the info error level. The stack trace for this exception will be output when this error level is enabled.
      Specified by:
      info in interface Log
      Parameters:
      error - the error that caused this log
    • info

      public void info(Supplier<String> content)
      Specified by:
      info in interface Log
    • info

      public void info(Supplier<String> content, Throwable error)
      Specified by:
      info in interface Log
    • warn

      public void warn(CharSequence content)
      Description copied from interface: Log
      Sends a message to the user in the warn error level.
      Specified by:
      warn in interface Log
      Parameters:
      content - the message to log
    • warn

      public void warn(CharSequence content, Throwable error)
      Description copied from interface: Log
      Sends a message (and accompanying exception) to the user in the warn error level. The error's stacktrace will be output when this error level is enabled.
      Specified by:
      warn in interface Log
      Parameters:
      content - the message to log
      error - the error that caused this log
    • warn

      public void warn(Throwable error)
      Description copied from interface: Log
      Sends an exception to the user in the warn error level. The stack trace for this exception will be output when this error level is enabled.
      Specified by:
      warn in interface Log
      Parameters:
      error - the error that caused this log
    • warn

      public void warn(Supplier<String> content)
      Specified by:
      warn in interface Log
    • warn

      public void warn(Supplier<String> content, Throwable error)
      Specified by:
      warn in interface Log
    • error

      public void error(CharSequence content)
      Description copied from interface: Log
      Sends a message to the user in the error error level.
      Specified by:
      error in interface Log
      Parameters:
      content - the message to log
    • error

      public void error(CharSequence content, Throwable error)
      Description copied from interface: Log
      Sends a message (and accompanying exception) to the user in the error error level. The error's stacktrace will be output when this error level is enabled.
      Specified by:
      error in interface Log
      Parameters:
      content - the message to log
      error - the error that caused this log
    • error

      public void error(Throwable error)
      Description copied from interface: Log
      Sends an exception to the user in the error error level. The stack trace for this exception will be output when this error level is enabled.
      Specified by:
      error in interface Log
      Parameters:
      error - the error that caused this log
    • error

      public void error(Supplier<String> content)
      Specified by:
      error in interface Log
    • error

      public void error(Supplier<String> content, Throwable error)
      Specified by:
      error in interface Log
    • isDebugEnabled

      public boolean isDebugEnabled()
      Description copied from interface: Log
      Returns true if the debug error level is enabled.
      Specified by:
      isDebugEnabled in interface Log
      Returns:
      true if the debug error level is enabled
    • isInfoEnabled

      public boolean isInfoEnabled()
      Description copied from interface: Log
      Returns true if the info error level is enabled.
      Specified by:
      isInfoEnabled in interface Log
      Returns:
      true if the info error level is enabled
    • isWarnEnabled

      public boolean isWarnEnabled()
      Description copied from interface: Log
      Returns true if the warn error level is enabled.
      Specified by:
      isWarnEnabled in interface Log
      Returns:
      true if the warn error level is enabled
    • isErrorEnabled

      public boolean isErrorEnabled()
      Description copied from interface: Log
      Returns true if the error error level is enabled.
      Specified by:
      isErrorEnabled in interface Log
      Returns:
      true if the error error level is enabled
    • child

      public Log child(String name)
      Description copied from interface: Log
      Returns a child logger whose name is derived from this logger's name by appending a dot and the given suffix.

      For example, if a plugin's logger is named "org.apache.maven.plugins.compiler.CompilerMojo", then child("diagnostics") returns a logger named "org.apache.maven.plugins.compiler.CompilerMojo.diagnostics". This lets sub-components log under an independently filterable name without requiring a separate injection point.

      The default implementation returns this, so existing Log implementations continue to work without changes. Implementations that wrap a hierarchical logging backend (such as SLF4J) should override this to create a real child logger.

      Specified by:
      child in interface Log
      Parameters:
      name - the suffix to append (must not be null or blank)
      Returns:
      a child logger — never null