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

Allow enabling debug logs #10137

Merged
merged 8 commits into from
Aug 3, 2023
Merged

Allow enabling debug logs #10137

merged 8 commits into from
Aug 3, 2023

Conversation

HoussemNasri
Copy link
Member

@HoussemNasri HoussemNasri commented Aug 2, 2023

Just pass --debug to the command line.

image

Mandatory checks

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

Copy link
Member

@koppor koppor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is good. I saw, there already is a --debug switch:

if (!cli.isBlank() && cli.isDebugLogging()) {

The check for --debug has to be done very early (due to our "broken" argument handling).

Suggestion (because of code reuse)

  • Remove these three lines (the if statement)
  • Use JabRef CLI directly to parse the arguemnts and handle it.

Siedlerchr
Siedlerchr previously approved these changes Aug 2, 2023
@Siedlerchr
Copy link
Member

we need to test the binary that comes out of this if it works

@HoussemNasri
Copy link
Member Author

HoussemNasri commented Aug 2, 2023

I tested it locally (on Linux) by creating an image with jlink, and the logs are written correctly to the selected log file.

@koppor koppor added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Aug 3, 2023
@Siedlerchr Siedlerchr merged commit 7d02ee9 into JabRef:main Aug 3, 2023
@HoussemNasri HoussemNasri deleted the enable-debug branch August 3, 2023 11:19
@Siedlerchr
Copy link
Member

xception in thread "main" java.lang.UnsupportedOperationException: Configuration cannot be changed after applying to tinylog
at [email protected]/org.tinylog.configuration.Configuration.set(Configuration.java:288)
at [email protected]/org.jabref.cli.Launcher.lambda$addLogToDisk$0(Launcher.java:124)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at [email protected]/org.jabref.cli.Launcher.addLogToDisk(Launcher.java:124)
at [email protected]/org.jabref.cli.Launcher.main(Launcher.java:60)

@Siedlerchr
Copy link
Member

Found the issue. It was the Localization.lang call

@HoussemNasri
Copy link
Member Author

Oops, I didn't test it after using JabRefCLI

Siedlerchr added a commit that referenced this pull request Aug 4, 2023
Fix cli debug log option

Fixes #10107
Follow up from #10137
@Siedlerchr Siedlerchr mentioned this pull request Aug 4, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants