Class Logger

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Logger.LogLevel
      Available levels of logging.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String LOG_HIDE_DATE
      Name of system property which will indicate if date should be hidden in the log.
      static Logger.LogLevel LOG_LEVEL
      Current log level.
      static java.lang.String LOG_LEVEL_PROPERTY
      Name of system property which will indicate logging level.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void debug​(@NotNull java.lang.String message, @NotNull java.lang.Object... args)
      Logs the given message at Logger.LogLevel.DEBUG level.
      void debug​(@NotNull java.lang.Throwable throwable)
      Logs the given throwable at Logger.LogLevel.DEBUG level.
      void debug​(@NotNull java.lang.Throwable throwable, @NotNull java.lang.String message, @NotNull java.lang.Object... args)
      Logs the given throwable and message at Logger.LogLevel.DEBUG level.
      static @NotNull Logger getLogger​(@NotNull java.lang.Class<?> forClass)
      Returns an instance of the logger for the given class.
      void info​(@NotNull java.lang.String message, @NotNull java.lang.Object... args)
      Logs the given message at Logger.LogLevel.INFO level.
      void info​(@NotNull java.lang.Throwable throwable)
      Logs the given throwable at Logger.LogLevel.INFO level.
      void info​(@NotNull java.lang.Throwable throwable, @NotNull java.lang.String message, @NotNull java.lang.Object... args)
      Logs the given throwable and message at Logger.LogLevel.INFO level.
      boolean isDebugEnabled()
      Returns true if logging at Logger.LogLevel.DEBUG is enabled.
      boolean isInfoEnabled()
      Returns true if logging at Logger.LogLevel.INFO is enabled.
      boolean isTraceEnabled()
      Returns true if logging at Logger.LogLevel.TRACE is enabled.
      void log​(@NotNull Logger.LogLevel logLevel, @NotNull java.lang.String message, @NotNull java.lang.Object... args)
      Logs the given message at logLevel.
      void log​(@NotNull Logger.LogLevel logLevel, @NotNull java.lang.Throwable throwable)
      Logs the given throwable at logLevel level.
      void log​(@NotNull Logger.LogLevel logLevel, @NotNull java.lang.Throwable throwable, @NotNull java.lang.String message, @NotNull java.lang.Object... args)
      Logs the given throwable and message at logLevel.
      void trace​(@NotNull java.lang.String message, @NotNull java.lang.Object... args)
      Logs the given message at Logger.LogLevel.TRACE level.
      void trace​(@NotNull java.lang.Throwable throwable)
      Logs the given throwable at Logger.LogLevel.TRACE level.
      void trace​(@NotNull java.lang.Throwable throwable, @NotNull java.lang.String message, @NotNull java.lang.Object... args)
      Logs the given throwable and message at Logger.LogLevel.TRACE level.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOG_LEVEL_PROPERTY

        public static final java.lang.String LOG_LEVEL_PROPERTY
        Name of system property which will indicate logging level. The value should be set to one of the values of Logger.LogLevel enum (case insensitive).

        Usage example:

        java -Dbamboo.specs.log.level=DEBUG ...
        See Also:
        Constant Field Values
      • LOG_HIDE_DATE

        public static final java.lang.String LOG_HIDE_DATE
        Name of system property which will indicate if date should be hidden in the log. Default is false.

        Usage example:

        java -Dbamboo.specs.log.hideDate=true ...
        See Also:
        Constant Field Values
      • LOG_LEVEL

        public static final Logger.LogLevel LOG_LEVEL
        Current log level.
    • Method Detail

      • getLogger

        @NotNull
        public static @NotNull Logger getLogger​(@NotNull
                                                @NotNull java.lang.Class<?> forClass)
        Returns an instance of the logger for the given class.
      • info

        public void info​(@NotNull
                         @NotNull java.lang.String message,
                         @NotNull
                         @NotNull java.lang.Object... args)
        Logs the given message at Logger.LogLevel.INFO level. The message is formatted using String.format(String, Object...).
      • info

        public void info​(@NotNull
                         @NotNull java.lang.Throwable throwable)
        Logs the given throwable at Logger.LogLevel.INFO level.
      • info

        public void info​(@NotNull
                         @NotNull java.lang.Throwable throwable,
                         @NotNull
                         @NotNull java.lang.String message,
                         @NotNull
                         @NotNull java.lang.Object... args)
        Logs the given throwable and message at Logger.LogLevel.INFO level. The message is formatted using String.format(String, Object...).
      • debug

        public void debug​(@NotNull
                          @NotNull java.lang.String message,
                          @NotNull
                          @NotNull java.lang.Object... args)
        Logs the given message at Logger.LogLevel.DEBUG level. The message is formatted using String.format(String, Object...).
      • debug

        public void debug​(@NotNull
                          @NotNull java.lang.Throwable throwable)
        Logs the given throwable at Logger.LogLevel.DEBUG level.
      • debug

        public void debug​(@NotNull
                          @NotNull java.lang.Throwable throwable,
                          @NotNull
                          @NotNull java.lang.String message,
                          @NotNull
                          @NotNull java.lang.Object... args)
        Logs the given throwable and message at Logger.LogLevel.DEBUG level. The message is formatted using String.format(String, Object...).
      • trace

        public void trace​(@NotNull
                          @NotNull java.lang.String message,
                          @NotNull
                          @NotNull java.lang.Object... args)
        Logs the given message at Logger.LogLevel.TRACE level. The message is formatted using String.format(String, Object...).
      • trace

        public void trace​(@NotNull
                          @NotNull java.lang.Throwable throwable)
        Logs the given throwable at Logger.LogLevel.TRACE level.
      • trace

        public void trace​(@NotNull
                          @NotNull java.lang.Throwable throwable,
                          @NotNull
                          @NotNull java.lang.String message,
                          @NotNull
                          @NotNull java.lang.Object... args)
        Logs the given throwable and message at Logger.LogLevel.TRACE level. The message is formatted using String.format(String, Object...).
      • log

        public void log​(@NotNull
                        @NotNull Logger.LogLevel logLevel,
                        @NotNull
                        @NotNull java.lang.String message,
                        @NotNull
                        @NotNull java.lang.Object... args)
        Logs the given message at logLevel. The message is formatted using String.format(String, Object...).
      • log

        public void log​(@NotNull
                        @NotNull Logger.LogLevel logLevel,
                        @NotNull
                        @NotNull java.lang.Throwable throwable)
        Logs the given throwable at logLevel level.
      • log

        public void log​(@NotNull
                        @NotNull Logger.LogLevel logLevel,
                        @NotNull
                        @NotNull java.lang.Throwable throwable,
                        @NotNull
                        @NotNull java.lang.String message,
                        @NotNull
                        @NotNull java.lang.Object... args)
        Logs the given throwable and message at logLevel. The message is formatted using String.format(String, Object...).
      • isInfoEnabled

        public boolean isInfoEnabled()
        Returns true if logging at Logger.LogLevel.INFO is enabled.
      • isDebugEnabled

        public boolean isDebugEnabled()
        Returns true if logging at Logger.LogLevel.DEBUG is enabled.
      • isTraceEnabled

        public boolean isTraceEnabled()
        Returns true if logging at Logger.LogLevel.TRACE is enabled.