From 2677da127b99bc4e6d904de3f14b8fe3f781740f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 17 Sep 2015 15:16:47 +0200 Subject: Integrate database statement tracing into our diagnostics machinery --- bpkg/diagnostics.cxx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'bpkg/diagnostics.cxx') 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 +#include + #include 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 (*this) << "PREPARE " << s.text (); + } + + void trace_mark_base:: + execute (odb::connection&, const char* stmt) + { + if (verb >= 5) + static_cast (*this) << stmt; + } + + void trace_mark_base:: + deallocate (odb::connection&, const odb::statement& s) + { + if (verb >= 6) + static_cast (*this) << "DEALLOCATE " << s.text (); + } + const basic_mark error ("error"); const basic_mark warn ("warning"); const basic_mark info ("info"); -- cgit v1.1