-
-
Notifications
You must be signed in to change notification settings - Fork 718
New issue
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
Use SLF4J as default logger #130
Comments
Please don't. It is trivial to implement Koin's |
I did as you suggested, but Koin still prints some statements before my code to set the logger is executed. I'm building using Koin as part of a Ktor project, so don't have control over the program's entry point. Writing anything to stdout is dangerous, so the current implementation could be seen by many as a blocker to using such a great library. Would you consider switching the default logger to Java Util Logging instead? Or even to have a service locator to allow me to change the logger by config, rather than programmatically? |
Sure, I agree Koin should not log anything by default. cf #50 |
Koin is just providing a default way to Log. Each project has to define its way of logging. For ktor & spark, we can provide a |
But why is it logging anything by default? I find that a bad practise, IMHO. |
You can configure logging before starting Koin container, with Spring framework & Ktor are logging by default ... why koin logging should be a bad thing? |
The point can be instead - log in debug level for the logging solution and let the user log it or not via its logging config. |
Is your feature request related to a problem? Please describe.
Having this as part of a production project isn't feasible without using a real logging implementation.
Describe the solution you'd like
An implementation of the koin Logger that uses SLF4J should be the default logger. If this isn't possible for Android apps, then could it be overriden as part of the android specific project?
Describe alternatives you've considered
Implementing my own is possible, but I'd prefer not to re-implement this in every project using Koin.
Target Koin project
koin-core (possibly also koin-android)
The text was updated successfully, but these errors were encountered: