-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add logback as logging framework #19
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't really comment on all the configuration of logback as I don't have any experience there.
Good news for you. I found that logback
and slf4j
are already part of the Fiji installation. (I simply searched for the jars in my Fiji installation.) So using it here should be fine. Not sure of what will happen if this project becomes part of the official mastodon, or Fiji.
@tinevez What do you think?
Sorry for closing the PR, that was an accident. |
Like Mathias my expertise is limited. Here! It will need to be rewritten of course, but could be a nice item for the beta-29. It would offer a service for all Mastodon plugins that you could subscribe to have progress bar and messages to the user. |
Thanks for pointing me to this approach. I like the LogPanel and I also like the ProgressBar! Nevertheless, I think, there is some benefit in combining this with logging framework. The logging framework provides some features out of the box:
There is the possibility of implementing a so called "Custom Appender" (cf. e.g. https://www.baeldung.com/custom-logback-appender) that could forward logging statements to the LogPanel and by this both approaches could be combined. |
@maarzt thanks for pointing out that |
@maarzt I requested a re-review, not in terms of code actually, but to see, if the conversations can be resolved so that the PR could be merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I though about this a little bit more:
- Logback is in fact not a compile time dependency of your code. SLF4J is the only dependency. You could declare logback as a "runtime", "test" or "optional" dependency in the maven pom. This might give a bit more freedom when putting this jar on an update site.
- The src/main/resources/logback.xml will be part of the compiled jar. To me this feels as if this configuration could override or cause a conflict the global logback configuration in FIJI. Maybe this is worth checking. Is "src/main/resource/logback.xml" actually needed?
- Maybe the best way is to have logback as a test-runtime dependency, and not messing with the FIJIs global logback configuration in the repo.
415f140
to
df61f3a
Compare
Thanks for this advice. I also read about logging in Fiji on https://imagej.net/develop/logging and your advice is perfectly in line what is stated there. I have changed the scope of the logback dependencies to
You are right. This is not the correct place for custom logback.xml. https://imagej.net/develop/logging states that a modified version of https://github.com/scijava/scijava-config should be delivered via the update sites instead. I deleted this file.
Fully agreed. |
df61f3a
to
3810a8d
Compare
…al in scijava project)
* Provide logback-core and logback-classic as test-runtime dependencies * Provide a logback-test.xml with project specific logging requirements
3810a8d
to
9991571
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
This Pull Request adds logback as a logging framework that may be used to print debug information at different levels and also to log files.
Log levels TRACE, DEBUG and INFO are forwarded to System.out
Log levels WARN and ERROR are forwarded to System.err.