Interface Logger

All Known Implementing Classes:
ProtoLogger

@Experimental public interface Logger
Defines a simple logging interface for Maven CLI operations. This interface provides methods for logging messages at different severity levels and supports logging with or without associated exceptions.
Since:
4.0.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    Represents the severity levels for log messages.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    debug(String message)
    Logs a debug message without an associated exception.
    default void
    debug(String message, Throwable error)
    Logs a debug message with an associated exception.
    default void
    error(String message)
    Logs an error message without an associated exception.
    default void
    error(String message, Throwable error)
    Logs an error message with an associated exception.
    default void
    info(String message)
    Logs an info message without an associated exception.
    default void
    info(String message, Throwable error)
    Logs an info message with an associated exception.
    default void
    log(Logger.Level level, String message)
    Logs a message at the specified level without an associated exception.
    void
    log(Logger.Level level, String message, Throwable error)
    Logs a message at the specified level with an associated exception.
    default void
    warn(String message)
    Logs a warning message without an associated exception.
    default void
    warn(String message, Throwable error)
    Logs a warning message with an associated exception.
  • Method Details

    • log

      default void log(@Nonnull Logger.Level level, @Nonnull String message)
      Logs a message at the specified level without an associated exception.
      Parameters:
      level - the severity level of the message
      message - the message to be logged
    • log

      void log(@Nonnull Logger.Level level, @Nonnull String message, @Nullable Throwable error)
      Logs a message at the specified level with an associated exception.
      Parameters:
      level - the severity level of the message
      message - the message to be logged
      error - the associated exception, or null if not applicable
    • debug

      default void debug(String message)
      Logs a debug message without an associated exception.
      Parameters:
      message - the debug message to be logged
    • debug

      default void debug(@Nonnull String message, @Nullable Throwable error)
      Logs a debug message with an associated exception.
      Parameters:
      message - the debug message to be logged
      error - the associated exception
    • info

      default void info(@Nonnull String message)
      Logs an info message without an associated exception.
      Parameters:
      message - the info message to be logged
    • info

      default void info(@Nonnull String message, @Nullable Throwable error)
      Logs an info message with an associated exception.
      Parameters:
      message - the info message to be logged
      error - the associated exception
    • warn

      default void warn(@Nonnull String message)
      Logs a warning message without an associated exception.
      Parameters:
      message - the warning message to be logged
    • warn

      default void warn(@Nonnull String message, @Nullable Throwable error)
      Logs a warning message with an associated exception.
      Parameters:
      message - the warning message to be logged
      error - the associated exception
    • error

      default void error(@Nonnull String message)
      Logs an error message without an associated exception.
      Parameters:
      message - the error message to be logged
    • error

      default void error(@Nonnull String message, @Nullable Throwable error)
      Logs an error message with an associated exception.
      Parameters:
      message - the error message to be logged
      error - the associated exception