Closed fcyu closed 8 months ago
but why?
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
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
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.
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
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
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.
There is no harm not deleting the old lib but the error message is quite annoying.
Thanks,
Fengchao