Interface KeyValuesEnvironment.Logger

Enclosing interface:
KeyValuesEnvironment

public static interface KeyValuesEnvironment.Logger
Key Values Resource focused logging facade and event capture. Logging level condition checking is purposely not supplied as these are more like events and many implementations will replay when the actual logging sytem loads.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    This signals that key values system will no longer be used to load resources and that some other system can now take over perhaps the logging system.
    void
    debug(String message)
    Logs a debug-level message.
    default void
    fatal(Exception exception)
    This is to signal failure that the KeyValueSystem cannot recover from while attempting to load.
    static String
    Turns a Level into a SLF4J like level String that is all upper case and same length with right padding.
    void
    info(String message)
    Logs an info-level message.
    default void
    When Key Values System is loaded.
    default void
    Logs a debug message indicating that a resource is being loaded.
    default void
    Logs an info message indicating that a resource has been successfully loaded.
    default void
    missing(KeyValuesResource resource, Exception exception)
    Logs a debug message indicating that a resource is missing.
    of()
    By default Ezkv does no logging because logging usually needs configuration loaded first (Ezkv in this case).
    of(System.Logger logger)
    Returns a logger that uses the supplied System.Logger.
    void
    warn(String message)
    Logs an warn-level message.
  • Method Details

    • of

      Returns a logger that uses the supplied System.Logger. Becareful using this because something downstream may need to configure the system logger based on Ezkv config.
      Parameters:
      logger - system logger.
      Returns:
      logger.
    • of

      By default Ezkv does no logging because logging usually needs configuration loaded first (Ezkv in this case).
      Returns:
      noop logger.
    • init

      default void init(KeyValuesSystem system)
      When Key Values System is loaded.
      Parameters:
      system - that was just created.
    • debug

      void debug(String message)
      Logs a debug-level message.
      Parameters:
      message - the message to log
    • info

      void info(String message)
      Logs an info-level message.
      Parameters:
      message - the message to log
    • warn

      void warn(String message)
      Logs an warn-level message.
      Parameters:
      message - the message to log
    • load

      default void load(KeyValuesResource resource)
      Logs a debug message indicating that a resource is being loaded.
      Parameters:
      resource - the resource being loaded
    • loaded

      default void loaded(KeyValuesResource resource)
      Logs an info message indicating that a resource has been successfully loaded.
      Parameters:
      resource - the loaded resource
    • missing

      default void missing(KeyValuesResource resource, Exception exception)
      Logs a debug message indicating that a resource is missing.
      Parameters:
      resource - the resource that was not found
      exception - the exception that occurred when the resource was not found
    • closed

      default void closed(KeyValuesSystem system)
      This signals that key values system will no longer be used to load resources and that some other system can now take over perhaps the logging system.
      Parameters:
      system - key value system that was closed.
    • fatal

      default void fatal(Exception exception)
      This is to signal failure that the KeyValueSystem cannot recover from while attempting to load.
      Parameters:
      exception - unrecoverable key values exception
    • formatLevel

      Turns a Level into a SLF4J like level String that is all upper case and same length with right padding. System.Logger.Level.ALL is "TRACE", System.Logger.Level.OFF is "ERROR" and System.Logger.Level.WARNING is "WARN".
      Parameters:
      level - system logger level.
      Returns:
      upper case string of level.