diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-09-17 15:16:47 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-09-17 15:16:47 +0200 |
commit | 2677da127b99bc4e6d904de3f14b8fe3f781740f (patch) | |
tree | e58e2c305ddba50a5e006f5f885f7b4327a9573e /bpkg/diagnostics.cxx | |
parent | 2dab23b28def943669796d60b42bede2f0c2cd7f (diff) |
Integrate database statement tracing into our diagnostics machinery
Diffstat (limited to 'bpkg/diagnostics.cxx')
-rw-r--r-- | bpkg/diagnostics.cxx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/bpkg/diagnostics.cxx b/bpkg/diagnostics.cxx index 697bd28..221bded 100644 --- a/bpkg/diagnostics.cxx +++ b/bpkg/diagnostics.cxx @@ -6,6 +6,8 @@ #include <iostream> +#include <odb/statement.hxx> + #include <bpkg/utility> using namespace std; @@ -98,6 +100,29 @@ namespace bpkg r << name_ << ": "; } + // trace + // + void trace_mark_base:: + prepare (odb::connection&, const odb::statement& s) + { + if (verb >= 6) + static_cast<trace_mark&> (*this) << "PREPARE " << s.text (); + } + + void trace_mark_base:: + execute (odb::connection&, const char* stmt) + { + if (verb >= 5) + static_cast<trace_mark&> (*this) << stmt; + } + + void trace_mark_base:: + deallocate (odb::connection&, const odb::statement& s) + { + if (verb >= 6) + static_cast<trace_mark&> (*this) << "DEALLOCATE " << s.text (); + } + const basic_mark error ("error"); const basic_mark warn ("warning"); const basic_mark info ("info"); |