Skip to content
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

suggestion for all libraries: implement a logging facade instead of the logger #217

Open
BradleyScrim opened this issue Jun 4, 2020 · 5 comments

Comments

@BradleyScrim
Copy link

BradleyScrim commented Jun 4, 2020

The jsbml-core library implements a logger with log4j. In v1.5 the log4j version is 2.3

Using this in a library in another project with another log-framework or other versions leads to conflicts. Especially if other libraries also bring their own logger.

Implementing a logging facade or a simple abstract LogListener could solve the problem. Everyone using the library has to register the concrete logger or implements the concrete Listener to connect it to the used logger framework.

Benefits

  • simplify code
  • keep dependency tree small
  • keep maintainability
@lcottret
Copy link

lcottret commented Jun 4, 2020

I completely agree ! It's very difficult to tune log4j when we use jsbml with other libraries using also log4j.

@draeger
Copy link
Member

draeger commented Jun 4, 2020

Would it help to replace the log4j dependency by Java's on-board logging mechanism?

@niko-rodrigue
Copy link
Member

We are staying on log4j 2.3 at the moment as we have not moved yet to required java 1.8. That 's probably something we should do for next release(s) as it prevent us to upgrade several libraries to their latest versions.

@BradleyScrim
Copy link
Author

Would it help to replace the log4j dependency by Java's on-board logging mechanism?

Sorry, "logging facade" seems to be the right word for what I mean. A nice short explanation can be found here.

@BradleyScrim BradleyScrim changed the title suggestion for all libraries: implement a log-listener and delete the logger suggestion for all libraries: implement a logging facade instead of the logger Jun 4, 2020
@niko-rodrigue
Copy link
Member

It was already my intention to move to the slf4j api and I just noticed they have a migration tool that would help to modify all the log4j call and import.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants