Class Logger

java.lang.Object
com.yubico.yubikit.core.Logger

public abstract class Logger
extends java.lang.Object
Helper class allows to customize logs within the SDK SDK has only 2 levels of logging: debug information and error If a Logger implementation is not provided the SDK won't produce any logs
  • Constructor Summary

    Constructors 
    Constructor Description
    Logger()  
  • Method Summary

    Modifier and Type Method Description
    static void d​(java.lang.String message)
    Log a debug message.
    static void e​(java.lang.String message, java.lang.Throwable throwable)
    Log an error message, together with an exception.
    protected void logDebug​(java.lang.String message)
    Specifies how debug messages are logged.
    protected void logError​(java.lang.String message, java.lang.Throwable throwable)
    Specifies how error messages (with exceptions) are logged.
    static void setLogger​(Logger logger)
    Set the Logger implementation to use.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • logDebug

      protected void logDebug​(java.lang.String message)
      Specifies how debug messages are logged.

      If this method is not overridden, then debug messages will not be logged.

      Parameters:
      message - the message can to be logged
    • logError

      protected void logError​(java.lang.String message, java.lang.Throwable throwable)
      Specifies how error messages (with exceptions) are logged.

      If this method is not overridden, then error messages will not be logged.

      Parameters:
      message - the message can to be logged
      throwable - the exception that can to be logged or counted
    • setLogger

      public static void setLogger​(@Nullable Logger logger)
      Set the Logger implementation to use. Override the logDebug and logError methods to produce logs. Call with null to disable logging.
      Parameters:
      logger - the Logger implementation to use
    • d

      public static void d​(java.lang.String message)
      Log a debug message.
    • e

      public static void e​(java.lang.String message, java.lang.Throwable throwable)
      Log an error message, together with an exception.