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

Do not print the error message when failed to delete the old native lib. #1088

Closed
wants to merge 1 commit into from

Conversation

fcyu
Copy link

@fcyu fcyu commented Mar 20, 2024

There is no harm not deleting the old lib but the error message is quite annoying.

Thanks,

Fengchao

There is no harm not deleting the old lib but the error message is quite annoying.
@gotson
Copy link
Collaborator

gotson commented Mar 21, 2024

but why?

@fcyu
Copy link
Author

fcyu commented Mar 21, 2024

One of our software uses sqlite-jdbc and prints a bunch of exception stacktrace when it couldn't delete the old native lib, which confuse users.

Thanks,

Fengchao

@gotson
Copy link
Collaborator

gotson commented Mar 21, 2024

i don't understand how users can be confused by log files, do users read logs as part of the application's normal behaviour ?

logs files are for investigation, not logging errors is not a good practice

@gotson
Copy link
Collaborator

gotson commented Mar 21, 2024

also your code does not make sense to me, as the loop is on files that are on disk and found matching the pattern, so using delete if exist is redundant, since the file exists.

You are just removing the logging in the catch block.

@fcyu
Copy link
Author

fcyu commented Mar 21, 2024

do users read logs as part of the application's normal behaviour ?

That's correct.

also your code does not make sense to me, as the loop is on files that are on disk and found matching the pattern, so using delete if exist is redundant, since the file exists.

Just in case that file was remove by other program right before executing delete(). There is almost no harm using deleteIfExists(), but feel free to change it.

Best,

Fengchao

@fcyu
Copy link
Author

fcyu commented Mar 21, 2024

Also, rather than throwing an exception, it prints the error message and stacktrace, which is hard to customize the behavior. If changing to throwing an exception, I guess I can catch it in my function and "mute" it.

Best,

Fengchao

@gotson
Copy link
Collaborator

gotson commented Mar 21, 2024

we are using SLF4J for logging, just change the logger configuration to disable that log statement.

I will close this, as this is not something we want to merge.

@gotson gotson closed this Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants