public final class RealmLog extends Object
RealmLogger
.Constructor and Description |
---|
RealmLog() |
Modifier and Type | Method and Description |
---|---|
static void |
add(Logger logger)
Deprecated.
use
add(RealmLogger) instead. |
static void |
add(RealmLogger logger)
Adds a logger implementation that will be notified on log events.
|
static void |
clear()
Removes all loggers.
|
static void |
debug(String message,
Object... args)
Logs a
LogLevel.DEBUG event. |
static void |
debug(Throwable throwable)
Logs a
LogLevel.DEBUG exception. |
static void |
debug(Throwable throwable,
String message,
Object... args)
Logs a
LogLevel.DEBUG event. |
static void |
error(String message,
Object... args)
Logs an
LogLevel.ERROR event. |
static void |
error(Throwable throwable)
Logs an
LogLevel.ERROR exception. |
static void |
error(Throwable throwable,
String message,
Object... args)
Logs an
LogLevel.ERROR event. |
static void |
fatal(String message,
Object... args)
Logs an
LogLevel.FATAL event. |
static void |
fatal(Throwable throwable)
Logs a
LogLevel.FATAL exception. |
static void |
fatal(Throwable throwable,
String message,
Object... args)
Logs a
LogLevel.FATAL event. |
static int |
getLevel()
Get the current
LogLevel . |
static void |
info(String message,
Object... args)
Logs an
LogLevel.INFO event. |
static void |
info(Throwable throwable)
Logs an
LogLevel.INFO exception. |
static void |
info(Throwable throwable,
String message,
Object... args)
Logs an
LogLevel.INFO event. |
static void |
registerDefaultLogger()
Adds default native logger if it has been removed before.
|
static boolean |
remove(Logger logger)
Deprecated.
use
remove(RealmLogger) instead. |
static boolean |
remove(RealmLogger logger)
Removes the given logger if it is currently added.
|
static void |
setLevel(int level)
Sets the current
LogLevel . |
static void |
trace(String message,
Object... args)
Logs a
LogLevel.TRACE event. |
static void |
trace(Throwable throwable)
Logs a
LogLevel.TRACE exception. |
static void |
trace(Throwable throwable,
String message,
Object... args)
Logs a
LogLevel.TRACE event. |
static void |
warn(String message,
Object... args)
Logs a
LogLevel.WARN event. |
static void |
warn(Throwable throwable)
Logs a
LogLevel.WARN exception. |
static void |
warn(Throwable throwable,
String message,
Object... args)
Logs a
LogLevel.WARN event. |
public static void add(RealmLogger logger)
logger
- the reference to a RealmLogger
implementation.public static void add(Logger logger)
add(RealmLogger)
instead.logger
- the reference to a Logger
implementation.public static void setLevel(int level)
LogLevel
. Setting this will affect all registered loggers.level
- see LogLevel
.public static boolean remove(RealmLogger logger)
true
if the logger was removed, false
otherwise.public static boolean remove(Logger logger)
remove(RealmLogger)
instead.true
if the logger was removed, false
otherwise.public static void clear()
registerDefaultLogger()
to
add it back.public static void registerDefaultLogger()
public static void trace(Throwable throwable)
LogLevel.TRACE
exception.throwable
- exception to log.public static void trace(String message, Object... args)
LogLevel.TRACE
event.message
- message to log.args
- optional args used to format the message using String.format(String, Object...)
.public static void trace(Throwable throwable, String message, Object... args)
LogLevel.TRACE
event.throwable
- optional exception to log.message
- optional message.args
- optional args used to format the message using String.format(String, Object...)
.public static void debug(Throwable throwable)
LogLevel.DEBUG
exception.throwable
- exception to log.public static void debug(String message, Object... args)
LogLevel.DEBUG
event.message
- message to log.args
- optional args used to format the message using String.format(String, Object...)
.public static void debug(Throwable throwable, String message, Object... args)
LogLevel.DEBUG
event.throwable
- optional exception to log.message
- optional message.args
- optional args used to format the message using String.format(String, Object...)
.public static void info(Throwable throwable)
LogLevel.INFO
exception.throwable
- exception to log.public static void info(String message, Object... args)
LogLevel.INFO
event.message
- message to log.args
- optional args used to format the message using String.format(String, Object...)
.public static void info(Throwable throwable, String message, Object... args)
LogLevel.INFO
event.throwable
- optional exception to log.message
- optional message.args
- optional args used to format the message using String.format(String, Object...)
.public static void warn(Throwable throwable)
LogLevel.WARN
exception.throwable
- exception to log.public static void warn(String message, Object... args)
LogLevel.WARN
event.message
- message to log.args
- optional args used to format the message using String.format(String, Object...)
.public static void warn(Throwable throwable, String message, Object... args)
LogLevel.WARN
event.throwable
- optional exception to log.message
- optional message.args
- optional args used to format the message using String.format(String, Object...)
.public static void error(Throwable throwable)
LogLevel.ERROR
exception.throwable
- exception to log.public static void error(String message, Object... args)
LogLevel.ERROR
event.message
- message to log.args
- optional args used to format the message using String.format(String, Object...)
.public static void error(Throwable throwable, String message, Object... args)
LogLevel.ERROR
event.throwable
- optional exception to log.message
- optional message.args
- optional args used to format the message using String.format(String, Object...)
.public static void fatal(Throwable throwable)
LogLevel.FATAL
exception.throwable
- exception to log.public static void fatal(String message, Object... args)
LogLevel.FATAL
event.message
- message to log.args
- optional args used to format the message using String.format(String, Object...)
.public static void fatal(Throwable throwable, String message, Object... args)
LogLevel.FATAL
event.throwable
- optional exception to log.message
- optional message.args
- optional args used to format the message using String.format(String, Object...)
.