We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://insert-koin.io/docs/1.0/reference/logging/
For posterity, can you add an example of how to replace the Logger (eg. Koin.logger = AndroidLogger()) or EmptyLogger()
Koin.logger = AndroidLogger()
EmptyLogger()
The text was updated successfully, but these errors were encountered:
To integrate the logging with ktor and slf4j I did something like this:
This is the logger implementation:
import org.koin.log.Logger class KoinLogger(private val logger: org.slf4j.Logger) : Logger { private val prefix = "(KOIN) :: " override fun debug(msg: String) { logger.debug(prefix + msg) } override fun err(msg: String) { logger.error(prefix + msg) } override fun log(msg: String) { logger.info(prefix + msg) } }
Here is how I use it:
fun Application.init() { Koin.logger = KoinLogger(environment.log) startKoin(arrayListOf(KoinModule)) install(DefaultHeaders) install(CallLogging) { level = Level.INFO } ...
Sorry, something went wrong.
You just need an implementation of Logger Koin class, and pass it to your startKoin().
Logger
startKoin()
Doc will be updated for this.
Check #143 for more info about new documentation
No branches or pull requests
https://insert-koin.io/docs/1.0/reference/logging/
For posterity, can you add an example of how to replace the Logger (eg.
Koin.logger = AndroidLogger()
) orEmptyLogger()
The text was updated successfully, but these errors were encountered: