DittoLogger

object DittoLogger

Singleton object with static methods to customize the logging behavior from Ditto.

Currently, Ditto uses the persistence directory of the Ditto instance that was most recently created to store a limited amount of logs. Ditto may continue writing logs to a persistence directory even after the associated Ditto instance is deallocated. If this is a concern, consider either disabling logging by setting DittoLogger.enabled to false, or instantiating a new Ditto instance. After either of these actions, it is safe to remove the persistence directory. Please refer to DittoLogger.exportToFile for further details on locally collected logs.

Types

Link copied to clipboard
object InternalDittoLogger : LoggerCb

Functions

Link copied to clipboard
suspend fun exportToFile(path: String): ULong

Exports collected logs to a compressed and JSON-encoded file on the local file system.

Link copied to clipboard
@JvmName(name = "exportToFile")
fun exportToFileBlocking(path: String): BigInteger

Exports collected logs to a compressed and JSON-encoded file on the local file system.

Link copied to clipboard
fun ffiCustomLog(cLogLevel: CLogLevel_t, msg: String)

Sends a single message to the log at the given log level.

Link copied to clipboard
fun setCustomLogCallback(logCallback: (DittoLogLevel, String) -> Unit?)
fun setCustomLogCallback(logCb: DittoLogCallback)

Registers a callback for a fully customizable way of handling log "events" from the logger (on top of logging to the console, and to a file, if any).

Link copied to clipboard
fun setLogFile(logFile: String?)

Registers a file path where logs will be written to, whenever Ditto wants to issue a log (on top of emitting the log to the console).

Link copied to clipboard
fun unsetCustomLogCallback()

Unregisters the currently registered callback (if any), to be used when interacting with the SDK from Java.

Properties

Link copied to clipboard
var emojiLogLevelHeadingsEnabled: Boolean

Represents whether logging levels are signified using emoji headings or classic words.

Link copied to clipboard
var enabled: Boolean

Represents whether logging is enabled.

Link copied to clipboard
var minimumLogLevel: DittoLogLevel

The minimum log level at which logs will be logged, provided enabled is true.