https://kotlinlang.org logo
#koin
Title
# koin
p

Pedro Alberto

02/15/2023, 8:27 AM
I don't think it's a good idea to provide the project in ZIP file can you simply paste the KOIN config you have in code?
а

Артур

02/15/2023, 10:55 AM
I took an example https://github.com/InsertKoinIO/koin-getting-started/tree/main/kotlin added dependency
Copy code
implementation("io.insert-koin:koin-logger-slf4j:3.3.1")
in gradle.kts and changed UserApplication.kt:
Copy code
class UserApplication : KoinComponent {

    val userService: UserService by inject()
    val logger: Logger by inject()

    init {
        userService.saveDefaultUsers()
    }
    fun sayHello() {
        val user = userService.getDefaultUser()
        val message = "Hello '$user'!"
        <http://logger.info|logger.info>(message)
        println(message)
    }
}

fun main() {
    startKoin {
        //logger(SLF4JLogger())
        logger(PrintLogger())
        modules(appModule)
    }

    UserApplication().sayHello()
}
appModule not changed
a

arnaud.giuliani

02/15/2023, 2:57 PM
your try to reach
org.koin.core.logger.Logger
which is an. internal of Koin
then, it’s normal to not find it in the container definitions
6 Views