Docs Menu

Class RealmLog

On this page

  • io.realm.log
  • Constructors
  • Method Summary
  • Inherited Methods
  • Constructor Detail
  • Method Detail
  • add
  • clear
  • debug
  • error
  • fatal
  • getLevel
  • info
  • registerDefaultLogger
  • remove
  • setLevel
  • trace
  • warn
java.lang.Object
io.realm.log.RealmLog

Global logger used by all Realm components. Custom loggers can be added by registering classes implementing RealmLogger .

Constructor and Description
Modifier and Type
Method and Description
public static void
add (
)

Adds a logger implementation that will be notified on log events.

public static void

Removes all loggers.

public static void
Throwable throwable,
String message,
)

Logs a LogLevel.DEBUG event.

public static void

Logs a LogLevel.DEBUG event.

public static void
Throwable throwable
)

Logs a LogLevel.DEBUG exception.

public static void
Throwable throwable,
String message,
)

Logs an LogLevel.ERROR event.

public static void

Logs an LogLevel.ERROR event.

public static void
Throwable throwable
)

Logs an LogLevel.ERROR exception.

public static void
Throwable throwable,
String message,
)

Logs a LogLevel.FATAL event.

public static void

Logs an LogLevel.FATAL event.

public static void
Throwable throwable
)

Logs a LogLevel.FATAL exception.

public static int

Get the current LogLevel .

public static void
Throwable throwable,
String message,
)

Logs an LogLevel.INFO event.

public static void

Logs an LogLevel.INFO event.

public static void
Throwable throwable
)

Logs an LogLevel.INFO exception.

public static void

Adds default native logger if it has been removed before.

public static boolean

Removes the given logger if it is currently added.

public static void
int level
)

Sets the current LogLevel .

public static void
Throwable throwable,
String message,
)

Logs a LogLevel.TRACE event.

public static void

Logs a LogLevel.TRACE event.

public static void
Throwable throwable
)

Logs a LogLevel.TRACE exception.

public static void
Throwable throwable,
String message,
)

Logs a LogLevel.WARN event.

public static void

Logs a LogLevel.WARN event.

public static void
Throwable throwable
)

Logs a LogLevel.WARN exception.

  • Methods inherited from class java.lang.Object : getClass , hashCode , equals , clone , toString , notify , notifyAll , wait , wait , wait , finalize
public RealmLog ()

public static void add (
)

Adds a logger implementation that will be notified on log events.

Parameters

  • logger - the reference to a RealmLogger implementation.
public static void clear ()

Removes all loggers. The default native logger will be removed as well. Use registerDefaultLogger() to add it back.
public static void debug (
Throwable throwable,
String message,
)

Logs a LogLevel.DEBUG event.

Parameters

public static void debug (
)

Logs a LogLevel.DEBUG event.

Parameters

public static void debug (
Throwable throwable
)

Logs a LogLevel.DEBUG exception.

Parameters

  • throwable - exception to log.
public static void error (
Throwable throwable,
String message,
)

Logs an LogLevel.ERROR event.

Parameters

public static void error (
)

Logs an LogLevel.ERROR event.

Parameters

public static void error (
Throwable throwable
)

Logs an LogLevel.ERROR exception.

Parameters

  • throwable - exception to log.
public static void fatal (
Throwable throwable,
String message,
)

Logs a LogLevel.FATAL event.

Parameters

public static void fatal (
)

Logs an LogLevel.FATAL event.

Parameters

public static void fatal (
Throwable throwable
)

Logs a LogLevel.FATAL exception.

Parameters

  • throwable - exception to log.
public static int getLevel ()

Get the current LogLevel .

Returns

the current LogLevel .

public static void info (
Throwable throwable,
String message,
)

Logs an LogLevel.INFO event.

Parameters

public static void info (
)

Logs an LogLevel.INFO event.

Parameters

public static void info (
Throwable throwable
)

Logs an LogLevel.INFO exception.

Parameters

  • throwable - exception to log.
public static void registerDefaultLogger ()

Adds default native logger if it has been removed before. If the default logger has been registered already, it won't be added again. The default logger on Android will log to logcat.
public static boolean remove (
)

Removes the given logger if it is currently added.

Returns

true if the logger was removed, false otherwise.

public static void setLevel (
int level
)

Sets the current LogLevel . Setting this will affect all registered loggers.

Parameters

public static void trace (
Throwable throwable,
String message,
)

Logs a LogLevel.TRACE event.

Parameters

public static void trace (
)

Logs a LogLevel.TRACE event.

Parameters

public static void trace (
Throwable throwable
)

Logs a LogLevel.TRACE exception.

Parameters

  • throwable - exception to log.
public static void warn (
Throwable throwable,
String message,
)

Logs a LogLevel.WARN event.

Parameters

public static void warn (
)

Logs a LogLevel.WARN event.

Parameters

public static void warn (
Throwable throwable
)

Logs a LogLevel.WARN exception.

Parameters

  • throwable - exception to log.
←  Class LogLevelInterface RealmLogger →
Give Feedback
© 2022 MongoDB, Inc.

About

  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2022 MongoDB, Inc.