Choose between StaticConfig and MutableLoggerConfig
mainKermit provides two types of configuration implementations:
StaticConfig: Values cannot be changed after initialization. This is the preferred choice for localLoggerinstances to maximize performance, as it avoids the overhead of volatile/atomic field access required for thread-safety in mutable configs.MutableLoggerConfig: Allows configuration values to be changed after theLoggeris created. This is used by the globalLoggerinstance and is necessary if you need to update a logger's settings at runtime.
If you want the convenience of a global logger but the performance of static configuration, you can define your own global object using StaticConfig via loggerConfigInit.
object MyLogger : Logger(
config = loggerConfigInit(
platformLogWriter(NoTagLogFormatter),
minSeverity = Severity.Info
),
tag = "MyAppTag"
)
fun hello(){
MyLogger.i { "Hello" }
}