-
Notifications
You must be signed in to change notification settings - Fork 156
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
Error logging #111
Error logging #111
Conversation
@bstarynk Maybe you can help testing this? |
@bstarynk Could you please comment :-) |
I am not sure to understand how this should be used in practice (I am probably confused by the relation between Sqlite errors and C++ exceptions). Maybe more comments could be useful. I am not sure to only want the error logging function to be activated after throwing some exception (but perhaps before that). BTW, in my melt-monitor (on github, e.g. commit 5b29edf1ef1b6621a0......) I have an additional wish. I am using extensively Ian Taylor's libbacktrace, and I would like to print the backtrace before throwing any sqlite exception. |
BTW, I would also like such new features to be testable with preprocessor flags, that is have perhaps |
@bstarynk This may be a documentation issue, why do you think the error logging is called after throwing the exception? The error logging, based on the SQLite log functionality, is kind of independant of C++ exceptions. During execution, if SQLite detects an error, it calls the error log callback. Your handler is called with a So using libbacktrace should work, just replace the |
This feature is implemented in a separate header, so with most modern compiler (gcc >= 5, clang, VC++ 2015(?)) you can test for it with #if __has_include(<sqlite_modern_cpp/log.h>)
...
#endif |
Implement SQL error logging based on error classes.
Closes #109.