Package icyllis.modernui.util

# 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 Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `DEBUG`
  A general debugging event.
  `static final int`
  `ERROR`
  An error in the application, possibly recoverable.
  `static final int`
  `FATAL`
  A fatal event that will prevent the application from continuing.
  `static final int`
  `INFO`
  An event for informational purposes.
  `static final int`
  `TRACE`
  A fine-grained debug message, typically capturing the flow through the application.
  `static final int`
  `WARN`
  An event that might possible lead to an error.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `catching(Throwable throwable)`
  Logs a `Throwable` that has been caught at the `ERROR` level.
  `static void`
  `debug(String tag, String msg)`
  Logs a message object with the `DEBUG` level.
  `static void`
  `debug(String tag, String msg, Object... params)`
  Logs a message object with the `DEBUG` level.
  `static void`
  `debug(String tag, String msg, Throwable throwable)`
  Logs a message at the `DEBUG` level including the stack trace of the `Throwable` `throwable` passed as parameter.
  `static void`
  `error(String tag, String msg)`
  Logs a message object with the `ERROR` level.
  `static void`
  `error(String tag, String msg, Object... params)`
  Logs a message object with the `ERROR` level.
  `static void`
  `error(String tag, String msg, Throwable throwable)`
  Logs a message at the `ERROR` level including the stack trace of the `Throwable` `throwable` passed as parameter.
  `static void`
  `fatal(String tag, String msg)`
  Logs a message object with the `FATAL` level.
  `static void`
  `fatal(String tag, String msg, Object... params)`
  Logs a message object with the `FATAL` level.
  `static void`
  `fatal(String tag, String msg, Throwable throwable)`
  Logs a message at the `FATAL` level including the stack trace of the `Throwable` `throwable` passed as parameter.
  `static void`
  `info(String tag, String msg)`
  Logs a message object with the `INFO` level.
  `static void`
  `info(String tag, String msg, Object... params)`
  Logs a message object with the `INFO` level.
  `static void`
  `info(String tag, String msg, Throwable throwable)`
  Logs a message at the `INFO` level including the stack trace of the `Throwable` `throwable` passed as parameter.
  `static void`
  `printf(int level, String tag, String format, Object... params)`
  Logs a formatted message using the specified format string and arguments.
  `static <T extends Throwable>
  T`
  `throwing(T throwable)`
  Logs a `Throwable` to be thrown at the `ERROR` level.
  `static void`
  `trace(String tag, String msg)`
  Logs a message object with the `TRACE` level.
  `static void`
  `trace(String tag, String msg, Object... params)`
  Logs a message object with the `TRACE` level.
  `static void`
  `trace(String tag, String msg, Throwable throwable)`
  Logs a message at the `TRACE` level including the stack trace of the `Throwable` `throwable` passed as parameter.
  `static void`
  `warn(String tag, String msg)`
  Logs a message object with the `WARN` level.
  `static void`
  `warn(String tag, String msg, Object... params)`
  Logs a message object with the `WARN` level.
  `static void`
  `warn(String tag, String msg, Throwable throwable)`
  Logs a message at the `WARN` level including the stack trace of the `Throwable` `throwable` passed as parameter.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### TRACE

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

  - ### DEBUG

    public static final int DEBUG
    A general debugging event.
    See Also:
      - Constant Field Values

  - ### INFO

    public static final int INFO
    An event for informational purposes.
    See Also:
      - Constant Field Values

  - ### WARN

    public static final int WARN
    An event that might possible lead to an error.
    See Also:
      - Constant Field Values

  - ### ERROR

    public static final int ERROR
    An error in the application, possibly recoverable.
    See Also:
      - Constant Field Values

  - ### FATAL

    public static final int FATAL
    A fatal event that will prevent the application from continuing.
    See Also:
      - Constant Field Values

- ## 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.