RealmLogger
for Android is implemented in native code. This class will be removed in a
future release.public class AndroidLogger extends Object implements Logger
Log
levels are mapped to Realm LogLevel
s using the following table:
LogLevel.ALL | Log.VERBOSE |
LogLevel.TRACE | Log.VERBOSE |
LogLevel.DEBUG | Log.DEBUG |
LogLevel.INFO | Log.INFO |
LogLevel.WARN | Log.WARN |
LogLevel.ERROR | Log.ERROR |
LogLevel.FATAL | Log.ERROR |
LogLevel.OFF | Not supported. Remove the logger instead. |
Constructor and Description |
---|
AndroidLogger(int androidLogLevel)
Deprecated.
Creates an logger that outputs to logcat.
|
Modifier and Type | Method and Description |
---|---|
void |
debug(Throwable throwable,
String message,
Object... args)
Deprecated.
Handles a
LogLevel.DEBUG event. |
void |
error(Throwable throwable,
String message,
Object... args)
Deprecated.
Handles an
LogLevel.ERROR event. |
void |
fatal(Throwable throwable,
String message,
Object... args)
Deprecated.
Handles a
LogLevel.FATAL event. |
int |
getMinimumNativeDebugLevel()
Deprecated.
Defines which
LogLevel events this logger cares about from the native components. |
void |
info(Throwable throwable,
String message,
Object... args)
Deprecated.
Handles an
LogLevel.INFO event. |
void |
setTag(String tag)
Deprecated.
Sets the logging tag used when outputting to LogCat.
|
void |
trace(Throwable throwable,
String message,
Object... args)
Deprecated.
Handles a
LogLevel.TRACE event. |
void |
warn(Throwable throwable,
String message,
Object... args)
Deprecated.
Handles a
LogLevel.WARN event. |
public AndroidLogger(int androidLogLevel)
androidLogLevel
- Android log levelpublic void setTag(String tag)
tag
- Logging tag to use for all subsequent logging calls.public int getMinimumNativeDebugLevel()
Logger
LogLevel
events this logger cares about from the native components.
If multiple loggers are registered, the minimum value among all loggers is used.
Note that sending log events from the native layer is relatively expensive, so only set this value to events that are truly useful.
getMinimumNativeDebugLevel
in interface Logger
LogLevel
native events this logger cares about.public void trace(Throwable throwable, String message, Object... args)
Logger
LogLevel.TRACE
event.trace
in interface Logger
throwable
- optional exception to log.message
- optional additional message.args
- optional arguments used to format the message using String.format(String, Object...)
.public void debug(Throwable throwable, String message, Object... args)
Logger
LogLevel.DEBUG
event.debug
in interface Logger
throwable
- optional exception to log.message
- optional additional message.args
- optional arguments used to format the message using String.format(String, Object...)
.public void info(Throwable throwable, String message, Object... args)
Logger
LogLevel.INFO
event.info
in interface Logger
throwable
- optional exception to log.message
- optional additional message.args
- optional arguments used to format the message using String.format(String, Object...)
.public void warn(Throwable throwable, String message, Object... args)
Logger
LogLevel.WARN
event.warn
in interface Logger
throwable
- optional exception to log.message
- optional additional message.args
- optional arguments used to format the message using String.format(String, Object...)
.public void error(Throwable throwable, String message, Object... args)
Logger
LogLevel.ERROR
event.error
in interface Logger
throwable
- optional exception to log.message
- optional additional message.args
- optional arguments used to format the message using String.format(String, Object...)
.public void fatal(Throwable throwable, String message, Object... args)
Logger
LogLevel.FATAL
event.fatal
in interface Logger
throwable
- optional exception to log.message
- optional additional message.args
- optional arguments used to format the message using String.format(String, Object...)
.