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
Classpath polution with slf4j-simple dependency in moco-core #99
Comments
Good suggestion. I tend to remove this dependency but I have to consider the scenario which user don't have any implementation for slf4j. Do you have any further suggestion for that? |
If the downstream project isn't using the slf4j-api, slf4j provides bridge modules that will route slf4j calls to the actual logging framework. This page http://www.slf4j.org/legacy.html describes scenarios for bridging calls between slf4j and other loggers. That will allow slf4j logging calls in the moco code to be forwarded to commons-logging, log4j, java util or other logger. |
@dreamhead When Slf4j detects no bindings on a classpath it generates warning on a console with the information where they could be found. Developer seeing that would need to add it as explicit dependency (he/she could choose slf4j-simple) when appropriate to have messages from moco logged. |
Thanks all. I've already remove slf4j-simple from core. You can build your own Moco until next Moco releases. |
moco-core
depends onslf4j-simple
which generates problems.It is the responsibility of the end project to provide
slf4j
implementation (usuallyslf4j-logback
orslf4j-log4j
) even in tests. When multipleslf4j
implementations (bindings) are on a classpathslf4j
isn't happy and emits warning.Maven/Gradle doesn't treat they (slf4j-logback and slf4j-simple) as the same library as they have different names and that is correct. It is required to manually exclude
slf4j-simple
in a build configuration.Summarizing IMHO there is no need to have
slf4j-simple
declared asmoco-core
dependency.The text was updated successfully, but these errors were encountered: