-
public class DittoLogger extends LoggerCb
Main singleton (global instance) to tweak the behavior of Ditto's logging infrastructure.
-
-
Field Summary
Fields Modifier and Type Field Description private static Booleanenabledprivate static DittoLogLevelminimumLogLevelprivate static BooleanemojiLogLevelHeadingsEnabledprivate final BooleanswigCMemOwnpublic final static DittoLoggerINSTANCE
-
Method Summary
Modifier and Type Method Description final static UnitsetLogFile(String logFile)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). final UnitsetCustomLogCallback(Function2<DittoLogLevel, String, Unit> logCallback)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). final static UnitsetCustomLogCallback(DittoLogCallback logCb)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). final static UnitunsetCustomLogCallback()Unregisters the currently registered callback (if any), to be used when interacting with the SDK from Java. UnitffiCustomLog(CLogLevel_t cLogLevel, String msg)final static BooleangetEnabled()final static UnitsetEnabled(Boolean enabled)final static DittoLogLevelgetMinimumLogLevel()final static UnitsetMinimumLogLevel(DittoLogLevel minimumLogLevel)final static BooleangetEmojiLogLevelHeadingsEnabled()final static UnitsetEmojiLogLevelHeadingsEnabled(Boolean emojiLogLevelHeadingsEnabled)-
Methods inherited from class live.ditto.DittoLogger
delete, finalize, registerCustomLogCb, swigDirectorDisconnect, swigReleaseOwnership, swigTakeOwnership, unregisterCustomLogCb -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
setLogFile
final static Unit setLogFile(String logFile)
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).
- Parameters:
logFile- can benil, in which case the current logging file, if any, is unregistered, otherwise, the file path must be within an already existing directory.
-
setCustomLogCallback
final Unit setCustomLogCallback(Function2<DittoLogLevel, String, Unit> logCallback)
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).
- Parameters:
logCallback- a callback that can benull, in which case the current callback, if any, is unregistered.
-
setCustomLogCallback
final static Unit setCustomLogCallback(DittoLogCallback logCb)
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).
Version to be used when interacting with the SDK from Java.
- Parameters:
logCb- a callback that can't benull.
-
unsetCustomLogCallback
final static Unit unsetCustomLogCallback()
Unregisters the currently registered callback (if any), to be used when interacting with the SDK from Java.
-
ffiCustomLog
Unit ffiCustomLog(CLogLevel_t cLogLevel, String msg)
-
getEnabled
final static Boolean getEnabled()
-
setEnabled
final static Unit setEnabled(Boolean enabled)
-
getMinimumLogLevel
final static DittoLogLevel getMinimumLogLevel()
-
setMinimumLogLevel
final static Unit setMinimumLogLevel(DittoLogLevel minimumLogLevel)
-
getEmojiLogLevelHeadingsEnabled
final static Boolean getEmojiLogLevelHeadingsEnabled()
-
setEmojiLogLevelHeadingsEnabled
final static Unit setEmojiLogLevelHeadingsEnabled(Boolean emojiLogLevelHeadingsEnabled)
-
-
-
-