Closed kutchar closed 7 years ago
@DavidGregory084 Any feedback/update on this?
Sorry @kutchar - I missed this somehow! I will take a look at this PR tomorrow.
No worries. Thanks.
Hi @kutchar, I understand your point about log & throw.
Perhaps this is a peculiarity in the way that we approach logging at JHC, but we do relatively little logging at the application level. If we can't handle an error in-process, we don't tend to catch the error: the process just dies. We make very little use of exceptions in our application logic so exceptions are pretty much considered fatal. That makes logging at library level particularly important.
I think that removing this logging will be problematic for us as it removes information that our operations staff need to diagnose environmental issues that come up from time to time (journalling disabled, SQL functions missing). OTOH, we do have a few additional layers of code above sqlest in which I could do this.
@p14n, what do you think?
@DavidGregory084 I see your point and it's nice to have sqlest log those exceptions with more context (i.e. the query) which are not available at layers above.
Another option would be to introduce a way for users to decide what exceptions should be logged, i.e. adding def shouldLogException(e: Throwable)
in Database
that by default would log everything. We could accomplish that by either adding a method to Database
that can be overriden or adding two more Database.withDataSource
methods that also take filter functions.
I like this approach since it wouldn't change the behavior of the library too much since others might be depending on these exception logs also.
"I think that removing this logging will be problematic for us as it removes information that our operations staff need to diagnose environmental issues that come up from time to time (journalling disabled, SQL functions missing). OTOH, we do have a few additional layers of code above sqlest in which I could do this."
I agree with @kutchar on this. I'm happy with either removing the logging or adding shouldThrow
. I think I have a preference for removing the logging. If we do this, we should make clear in the release notes for the new version.
If we remove the logging, we should scan as many of our internal test instances for errors from this class and check that for that request the error has been logged further up the stack.
Hey guys, any update on this?
@kutchar Sorry for keeping you waiting! Been struggling to set aside time to work on the changes we need to make on our end but that shouldn't block your PR.
@DavidGregory084 No problem, thanks for merging it. Any idea when you'd be able to release it?
Should have been on its way but I'm wrangling with sbt-pgp - bear with me
Okay, 0.8.10 should be on its way to central now, thanks @kutchar!
Thanks!
Codecov Report
66.17% <85.71%> (+0.68%)
Continue to review full report at Codecov.