SysLog

actual class SysLog : Log(source)
actual class SysLog : Log(source)
expect class SysLog : Log(source)

Formats and then prints logs to the following system locations.

NOTE: This Log implementation is meant for non-production environments. Logging to stdout/stderr in production is violence. For this reason, Debug is configured with Log.Level.Debug. If you DO happen to choose violence for your production environment, SysLog.of should be used to configure a more appropriate minimum Log.Level.

NOTE: On Android & AndroidNative API 25 and below, Logger.domain is never used and Logger.tag will be truncated (if necessary) to 23 characters.

NOTE: On Android, AndroidNative, Js/WasmJs Node, and Js/WasmJs Browser, there are log length limitations of 4_000, 1_000, 8_000, and 2_000 characters, respectively. In the event a log exceeds the maximum, SysLog will log in chunks of the maximum allowable size using the last available new line character (i.e. \r or \n) in each chunk. If no new line characters are available, then the last available whitespace is used as to not split mid-word. Lastly, if no whitespace is available, the maximum allowable length is chunked; undesirable, but highly unlikely to happen.

Except for Android & AndroidNative (Logcat has its own format), the same format is applied for all other platforms; it resembles Android Logcat almost identically. Do note that time is displayed using local time, with the caveat of WasmWasi which is in UTC and indicates so with the trailing Z character (e.g. 10-17 22:19:16.179Z).

e.g.

Log.install(SysLog.Debug)
Log.Logger.of(tag = "YourLogger").i("Hello World!")
Log.Logger.of(tag = "YourLogger2", domain = "your.domain").w("Yo!")

// 10-17 22:19:16.179 D [kmp-log:log]Log.Root: SysLog[min=Debug, max=Fatal, uid=io.matthewnelson.kmp.log.sys.SysLog].onInstall()
// 10-17 22:19:16.179 I YourLogger: Hello World!
// 10-17 22:19:16.181 W [your.domain]YourLogger2: Yo!
actual class SysLog : Log(source)
actual class SysLog : Log(source)
actual class SysLog : Log(source)
actual class SysLog : Log(source)
actual class SysLog : <ERROR CLASS> ERROR CLASS: Symbol not found for Log(source)
actual class SysLog : Log(source)

Types

Link copied to clipboard
actual object Companion
actual object Companion
expect object Companion
actual object Companion
actual object Companion
actual object Companion
actual object Companion
actual object Companion
actual object Companion

Functions

Link copied to clipboard
protected actual open override fun isLoggable(level: Log.Level, domain: String?, tag: String): Boolean
protected actual open override fun isLoggable(level: Log.Level, domain: String?, tag: String): Boolean
protected expect open override fun isLoggable(level: Log.Level, domain: String?, tag: String): Boolean
protected actual open override fun isLoggable(level: Log.Level, domain: String?, tag: String): Boolean
protected actual open override fun isLoggable(level: Log.Level, domain: String?, tag: String): Boolean
protected actual open override fun isLoggable(level: Log.Level, domain: String?, tag: String): Boolean
protected actual open override fun isLoggable(level: Log.Level, domain: String?, tag: String): Boolean
actual open override fun isLoggable(level: ERROR CLASS: Symbol not found for Level, domain: String?, tag: String): Boolean
protected actual open override fun isLoggable(level: Log.Level, domain: String?, tag: String): Boolean
Link copied to clipboard
protected actual open override fun log(level: Log.Level, domain: String?, tag: String, msg: String?, t: Throwable?): Boolean
protected actual open override fun log(level: Log.Level, domain: String?, tag: String, msg: String?, t: Throwable?): Boolean
protected expect open override fun log(level: Log.Level, domain: String?, tag: String, msg: String?, t: Throwable?): Boolean
protected actual open override fun log(level: Log.Level, domain: String?, tag: String, msg: String?, t: Throwable?): Boolean
protected actual open override fun log(level: Log.Level, domain: String?, tag: String, msg: String?, t: Throwable?): Boolean
protected actual open override fun log(level: Log.Level, domain: String?, tag: String, msg: String?, t: Throwable?): Boolean
protected actual open override fun log(level: Log.Level, domain: String?, tag: String, msg: String?, t: Throwable?): Boolean
actual open override fun log(level: ERROR CLASS: Symbol not found for Level, domain: String?, tag: String, msg: String?, t: Throwable?): Boolean
protected actual open override fun log(level: Log.Level, domain: String?, tag: String, msg: String?, t: Throwable?): Boolean