Interface ILogger

All Known Implementing Classes:
Logger, TestLogger

public interface ILogger
Logging code interface
  • Method Details

    • logDebug

      void logDebug(ThrowingSupplier<String,Exception> msg)
      Logs helpful debugging information
      Parameters:
      msg - a lambda for what is to be logged. example: () -> "Hello"
    • logTrace

      void logTrace(ThrowingSupplier<String,Exception> msg)
      Logs helpful debugging information

      Similar to logDebug(ThrowingSupplier) but used for code that runs very often, requires extra calculation, or has data of large size.

      It is possible to disable trace logs and thus avoid performance impacts unless the data is needed for deeper investigation.

      Parameters:
      msg - a lambda for what is to be logged. example: () -> "Hello"
    • logAsyncError

      void logAsyncError(ThrowingSupplier<String,Exception> msg)
      Logs helpful debugging information inside threads
      Parameters:
      msg - a lambda for what is to be logged. example: () -> "Hello"
    • logAudit

      void logAudit(ThrowingSupplier<String,Exception> msg)
      This is for logging business-related topics

      This log type is expected to be printed least-often, and should directly relate to a user action. An example would be "New user created: alice"

      msg a lambda for what is to be logged. example: () -> "Hello"
    • stop

      void stop()
      When we are shutting down the system it is necessary to explicitly stop the logger.

      The logger has to stand apart from the rest of the system, or else we'll have circular dependencies.

    • getActiveLogLevels

      Map<LoggingLevel,Boolean> getActiveLogLevels()
      This method can be used to adjust the active log levels, which is a mapping of keys of LoggingLevel to boolean values. If the boolean value is true, that level of logging is enabled.