Class Log

java.lang.Object
icyllis.modernui.util.Log

public final class Log extends Object
Framework wrapper over Log4j API for sending log output.
Since:
3.10
  • Field Details

    • TRACE

      public static final int TRACE
      A fine-grained debug message, typically capturing the flow through the application.
      See Also:
    • DEBUG

      public static final int DEBUG
      A general debugging event.
      See Also:
    • INFO

      public static final int INFO
      An event for informational purposes.
      See Also:
    • WARN

      public static final int WARN
      An event that might possible lead to an error.
      See Also:
    • ERROR

      public static final int ERROR
      An error in the application, possibly recoverable.
      See Also:
    • FATAL

      public static final int FATAL
      A fatal event that will prevent the application from continuing.
      See Also:
  • Method Details

    • trace

      public static void trace(@Nullable String tag, @NonNull String msg)
      Logs a message object with the TRACE level.
      Parameters:
      tag - used to identify the source of a log message.
      msg - the message string to log.
    • trace

      public static void trace(@Nullable String tag, @NonNull String msg, Object... params)
      Logs a message object with the TRACE level.
      Parameters:
      tag - used to identify the source of a log message.
      msg - the message string to log.
      params - parameters to the message.
    • trace

      public static void trace(@Nullable String tag, @NonNull String msg, Throwable throwable)
      Logs a message at the TRACE level including the stack trace of the Throwable throwable passed as parameter.
      Parameters:
      tag - used to identify the source of a log message.
      msg - the message string to log.
      throwable - the Throwable to log, including its stack trace.
    • debug

      public static void debug(@Nullable String tag, @NonNull String msg)
      Logs a message object with the DEBUG level.
      Parameters:
      tag - used to identify the source of a log message.
      msg - the message string to log.
    • debug

      public static void debug(@Nullable String tag, @NonNull String msg, Object... params)
      Logs a message object with the DEBUG level.
      Parameters:
      tag - used to identify the source of a log message.
      msg - the message string to log.
      params - parameters to the message.
    • debug

      public static void debug(@Nullable String tag, @NonNull String msg, Throwable throwable)
      Logs a message at the DEBUG level including the stack trace of the Throwable throwable passed as parameter.
      Parameters:
      tag - used to identify the source of a log message.
      msg - the message string to log.
      throwable - the Throwable to log, including its stack trace.
    • info

      public static void info(@Nullable String tag, @NonNull String msg)
      Logs a message object with the INFO level.
      Parameters:
      tag - used to identify the source of a log message.
      msg - the message string to log.
    • info

      public static void info(@Nullable String tag, @NonNull String msg, Object... params)
      Logs a message object with the INFO level.
      Parameters:
      tag - used to identify the source of a log message.
      msg - the message string to log.
      params - parameters to the message.
    • info

      public static void info(@Nullable String tag, @NonNull String msg, Throwable throwable)
      Logs a message at the INFO level including the stack trace of the Throwable throwable passed as parameter.
      Parameters:
      tag - used to identify the source of a log message.
      msg - the message string to log.
      throwable - the Throwable to log, including its stack trace.
    • warn

      public static void warn(@Nullable String tag, @NonNull String msg)
      Logs a message object with the WARN level.
      Parameters:
      tag - used to identify the source of a log message.
      msg - the message string to log.
    • warn

      public static void warn(@Nullable String tag, @NonNull String msg, Object... params)
      Logs a message object with the WARN level.
      Parameters:
      tag - used to identify the source of a log message.
      msg - the message string to log.
      params - parameters to the message.
    • warn

      public static void warn(@Nullable String tag, @NonNull String msg, Throwable throwable)
      Logs a message at the WARN level including the stack trace of the Throwable throwable passed as parameter.
      Parameters:
      tag - used to identify the source of a log message.
      msg - the message string to log.
      throwable - the Throwable to log, including its stack trace.
    • error

      public static void error(@Nullable String tag, @NonNull String msg)
      Logs a message object with the ERROR level.
      Parameters:
      tag - used to identify the source of a log message.
      msg - the message string to log.
    • error

      public static void error(@Nullable String tag, @NonNull String msg, Object... params)
      Logs a message object with the ERROR level.
      Parameters:
      tag - used to identify the source of a log message.
      msg - the message string to log.
      params - parameters to the message.
    • error

      public static void error(@Nullable String tag, @NonNull String msg, Throwable throwable)
      Logs a message at the ERROR level including the stack trace of the Throwable throwable passed as parameter.
      Parameters:
      tag - used to identify the source of a log message.
      msg - the message string to log.
      throwable - the Throwable to log, including its stack trace.
    • fatal

      public static void fatal(@Nullable String tag, @NonNull String msg)
      Logs a message object with the FATAL level.
      Parameters:
      tag - used to identify the source of a log message.
      msg - the message string to log.
    • fatal

      public static void fatal(@Nullable String tag, @NonNull String msg, Object... params)
      Logs a message object with the FATAL level.
      Parameters:
      tag - used to identify the source of a log message.
      msg - the message string to log.
      params - parameters to the message.
    • fatal

      public static void fatal(@Nullable String tag, @NonNull String msg, Throwable throwable)
      Logs a message at the FATAL level including the stack trace of the Throwable throwable passed as parameter.
      Parameters:
      tag - used to identify the source of a log message.
      msg - the message string to log.
      throwable - the Throwable to log, including its stack trace.
    • catching

      public static void catching(Throwable throwable)
      Logs a Throwable that has been caught at the ERROR level.
      Parameters:
      throwable - the Throwable.
    • throwing

      public static <T extends Throwable> T throwing(T throwable)
      Logs a Throwable to be thrown at the ERROR level. This may be coded as:
       throw Log.throwing(e);
       
      Type Parameters:
      T - the Throwable type.
      Parameters:
      throwable - The Throwable.
      Returns:
      the Throwable.
    • printf

      public static void printf(int level, @Nullable String tag, String format, Object... params)
      Logs a formatted message using the specified format string and arguments.
      Parameters:
      level - The logging level.
      tag - Used to identify the source of a log message.
      format - The format String.
      params - Arguments specified by the format.