-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update
log
object to be a dedicated logger to avoid config overwrit…
…ing other kermit users, and add `setKotliteStdlibLogMinLevel` global function
- Loading branch information
1 parent
a781993
commit 06b0da7
Showing
4 changed files
with
32 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 11 additions & 5 deletions
16
interpreter/src/commonMain/kotlin/com/sunnychung/lib/multiplatform/kotlite/Globals.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
package com.sunnychung.lib.multiplatform.kotlite | ||
|
||
import co.touchlab.kermit.LogWriter | ||
import co.touchlab.kermit.Logger | ||
import co.touchlab.kermit.MutableLoggerConfig | ||
import co.touchlab.kermit.Severity | ||
import co.touchlab.kermit.platformLogWriter | ||
|
||
internal val log = Logger.apply { | ||
setTag("kotlite") | ||
setMinSeverity(Severity.Info) | ||
} | ||
internal val log = Logger( | ||
config = object : MutableLoggerConfig { | ||
override var logWriterList: List<LogWriter> = listOf(platformLogWriter()) | ||
override var minSeverity: Severity = Severity.Info | ||
}, | ||
tag = "kotlite", | ||
) | ||
|
||
fun setKotliteLogMinLevel(severity: Severity) { | ||
log.setMinSeverity(severity) | ||
(log.config as MutableLoggerConfig).minSeverity = severity | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 13 additions & 3 deletions
16
stdlib/src/commonMain/kotlin/com/sunnychung/lib/multiplatform/kotlite/stdlib/StdlibGlobal.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
package com.sunnychung.lib.multiplatform.kotlite.stdlib | ||
|
||
import co.touchlab.kermit.LogWriter | ||
import co.touchlab.kermit.Logger | ||
import co.touchlab.kermit.MutableLoggerConfig | ||
import co.touchlab.kermit.Severity | ||
import co.touchlab.kermit.platformLogWriter | ||
|
||
internal val log = Logger.apply { | ||
setTag("kotlite-stdlib") | ||
setMinSeverity(Severity.Info) | ||
internal val log = Logger( | ||
config = object : MutableLoggerConfig { | ||
override var logWriterList: List<LogWriter> = listOf(platformLogWriter()) | ||
override var minSeverity: Severity = Severity.Info | ||
}, | ||
tag = "kotlite-stdlib", | ||
) | ||
|
||
fun setKotliteStdlibLogMinLevel(severity: Severity) { | ||
(log.config as MutableLoggerConfig).minSeverity = severity | ||
} |