Interface Logger

  • All Superinterfaces:
    Logger
    All Known Implementing Classes:
    Lf4OsgiLogger

    public interface Logger
    extends Logger
    An extended OSGi Logger interface. It provides the additional methods that accept a Supplier for the message as a parameter. This allows you to write statements such as:
     logger.warn(() -> String.format("Value is %d.", 42));
     
    • Method Detail

      • trace

        void trace​(Supplier<String> messageSupplier)
        If trace level is enabled, get the message from the supplier and log it.
        Parameters:
        messageSupplier - the message supplier
      • trace

        void trace​(Supplier<String> messageSupplier,
                   Throwable thr)
        If trace level is enabled, get the message from the supplier and log it together withe the provided throwable.
        Parameters:
        messageSupplier - the message supplier
        thr - the Throwable
      • debug

        void debug​(Supplier<String> messageSupplier)
        If debug level is enabled, get the message from the supplier and log it.
        Parameters:
        messageSupplier - the message supplier
      • debug

        void debug​(Supplier<String> messageSupplier,
                   Throwable thr)
        If debug level is enabled, get the message from the supplier and log it together withe the provided throwable.
        Parameters:
        messageSupplier - the message supplier
        thr - the Throwable
      • info

        void info​(Supplier<String> messageSupplier)
        If info level is enabled, get the message from the supplier and log it.
        Parameters:
        messageSupplier - the message supplier
      • info

        void info​(Supplier<String> messageSupplier,
                  Throwable thr)
        If info level is enabled, get the message from the supplier and log it together withe the provided throwable.
        Parameters:
        messageSupplier - the message supplier
        thr - the Throwable
      • warn

        void warn​(Supplier<String> messageSupplier)
        If warn level is enabled, get the message from the supplier and log it.
        Parameters:
        messageSupplier - the message supplier
      • warn

        void warn​(Supplier<String> messageSupplier,
                  Throwable thr)
        If warn level is enabled, get the message from the supplier and log it together withe the provided throwable.
        Parameters:
        messageSupplier - the message supplier
        thr - the Throwable
      • error

        void error​(Supplier<String> messageSupplier)
        If error level is enabled, get the message from the supplier and log it.
        Parameters:
        messageSupplier - the message supplier
      • error

        void error​(Supplier<String> messageSupplier,
                   Throwable thr)
        If error level is enabled, get the message from the supplier and log it together withe the provided throwable.
        Parameters:
        messageSupplier - the message supplier
        thr - the Throwable