LogHelper

object LogHelper

A configuration helper that allows modifying the log level for specific loggers

Functions

Link copied to clipboard
fun reset(vararg names: String)

Removes custom configuration for the specified logger names

fun reset(vararg classes: KClass<*>): <Error class: unknown class>
Link copied to clipboard
fun setLevel(vararg loggerNames: String)

Takes a set of strings identifying logger names for which the logging level should be configured. If the logger name starts with a + or an ordinary character, the level is set to Level.ALL. If it starts with a - then logging is switched off.

fun setLevel(vararg classes: KClass<*>): <Error class: unknown class>
Link copied to clipboard
inline fun <T> withLevel(logName: String, levelName: String, block: () -> T): <Error class: unknown class>

May fail to restore the original level due to unavoidable race if called by multiple threads.