jvmMain.index_jvm.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of logging-jvm Show documentation
Show all versions of logging-jvm Show documentation
"Logging Tools For Kotlin"
package de.peekandpoke.ultra.logging
import de.peekandpoke.ultra.kontainer.InjectionContext
import de.peekandpoke.ultra.kontainer.KontainerBuilder
import de.peekandpoke.ultra.kontainer.module
@Suppress("unused")
fun KontainerBuilder.ultraLogging() = module(Ultra_Logging)
/**
* Ultra Logging kontainer module
*
* You can inject context aware instances of [Log] into your kontainer services:
*
*
* class MyService(log: Log) { ... }
*
*
* For a simple [ConsoleAppender] add a:
*
*
* singleton(ConsoleAppender::class)
*
*
* For an [Slf4jAppender] add a:
*
*
* singleton { logger: org.slf4j.Logger -> Slf4jAppender(logger) }
*
*/
val Ultra_Logging = module {
dynamic(UltraLogManager::class)
// TODO: we need another injection type: dynamicPrototype.
// It must upgrade the injecting service to SemiDynamic.
// But it must be instantiated like a prototype.
prototype(Log::class) { manager: UltraLogManager, context: InjectionContext ->
manager.getLogger(context.requestingClass)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy