Package com.luciad

Interface ILoggingBackend


public interface ILoggingBackend
Backend for the logging in this library.

Users can implement this backend to delegate the internal logging to their framework of choice. The implementation must then be configured during global initialization in order to be used by this library.

Implementations must be thread-safe. All methods will be called concurrently from various threads.

Note that the only purpose of this interface is to facilitate redirecting the logging performed by this library. We expect that, in your own code, you use your framework of choice directly.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Indicates that the logger with the given handle is not used anymore.
    boolean
    isEnabled(Object handle, LogLevel level)
    Returns whether logging output is enabled for the specified logger at the given level.
    void
    log(Object handle, LogLevel level, String message)
    This function will not be called if \a level is not enabled for \a logger.
    void
    log(Object handle, LogLevel level, String message, Throwable exception)
    This function will not be called if \a level is not enabled for \a logger.
    Creates a new handle for a logger with the given \a name.
  • Method Details

    • newLogger

      @NotNull Object newLogger(@NotNull String name)
      Creates a new handle for a logger with the given \a name. At any time, at most one Handle is requested for a given name. This means that, unless a previously returned handle for a name is \link deleteLogger deleted \endlink, this function will be not be called again with that same name.
      Parameters:
      name - the name of the logger that is requested
      Returns:
      a handle for the new logger
    • isEnabled

      boolean isEnabled(@Nullable Object handle, @NotNull LogLevel level)
      Returns whether logging output is enabled for the specified logger at the given level.
      Parameters:
      handle - identifies a logger
      level - a specific logging level
      Returns:
      whether logging output is enabled for the specified logger at the given level
    • log

      void log(@Nullable Object handle, @NotNull LogLevel level, @NotNull String message)
      This function will not be called if \a level is not enabled for \a logger.
      Parameters:
      handle - identifies a logger
      level - a specific logging level
      message - the message to log
    • log

      void log(@Nullable Object handle, @NotNull LogLevel level, @NotNull String message, @NotNull Throwable exception)
      This function will not be called if \a level is not enabled for \a logger.
      Parameters:
      handle - identifies a logger
      level - a specific logging level
      message - the message to log
      exception - the exception associated with the message
    • deleteLogger

      void deleteLogger(@Nullable Object handle)
      Indicates that the logger with the given handle is not used anymore. Implementations could delete the corresponding resource, if any.
      Parameters:
      handle - a handle previously returned by newLogger(std::string)