@LevelUpApi(contract=INTERNAL) @ThreadSafe public final class LogManager extends Object
Log
class.
Because logging is expensive, it is recommended that clients of this class strip out logging statements at compile time using ProGuard.
Modifier and Type | Method and Description |
---|---|
static void |
d(String msg,
Object... args)
Log a message.
|
static void |
d(String msg,
Throwable err)
Log a message.
|
static void |
e(String msg,
Object... args)
Log a message.
|
static void |
e(String msg,
Throwable err)
Log a message.
|
static void |
i(String msg,
Object... args)
Log a message.
|
static void |
i(String msg,
Throwable err)
Log a message.
|
static void |
init(Context context)
Initializes logging.
|
static void |
v(String msg,
Object... args)
Log a message.
|
static void |
v(String msg,
Throwable err)
Log a message.
|
static void |
w(String msg,
Object... args)
Log a message.
|
static void |
w(String msg,
Throwable err)
Log a message.
|
public static void init(Context context)
This should be called from Application.onCreate()
. (It may also need to
be called from ContentProvider.onCreate()
due to when the provider is
initialized.)
context
- Application context.public static void v(String msg, Object... args)
msg
- message to log. This message is expected to be a format string if varargs are
passed in.args
- optional arguments to be formatted into msg
.public static void v(String msg, Throwable err)
msg
- message to log.err
- an exception that occurred, whose trace will be printed with the log message.public static void d(String msg, Object... args)
msg
- message to log. This message is expected to be a format string if varargs are
passed in.args
- optional arguments to be formatted into msg
.public static void d(String msg, Throwable err)
msg
- message to log.err
- an exception that occurred, whose trace will be printed with the log message.public static void i(String msg, Object... args)
msg
- message to log. This message is expected to be a format string if varargs are
passed in.args
- optional arguments to be formatted into msg
.public static void i(String msg, Throwable err)
msg
- message to log.err
- an exception that occurred, whose trace will be printed with the log message.public static void w(String msg, Object... args)
msg
- message to log. This message is expected to be a format string if varargs are
passed in.args
- optional arguments to be formatted into msg
.public static void w(String msg, Throwable err)
msg
- message to log.err
- an exception that occurred, whose trace will be printed with the log message.public static void e(String msg, Object... args)
msg
- message to log. This message is expected to be a format string if varargs are
passed in.args
- optional arguments to be formatted into msg
.