aboutsummaryrefslogtreecommitdiff
path: root/bpkg/diagnostics.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-09-17 15:16:47 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-09-17 15:16:47 +0200
commit2677da127b99bc4e6d904de3f14b8fe3f781740f (patch)
treee58e2c305ddba50a5e006f5f885f7b4327a9573e /bpkg/diagnostics.cxx
parent2dab23b28def943669796d60b42bede2f0c2cd7f (diff)
Integrate database statement tracing into our diagnostics machinery
Diffstat (limited to 'bpkg/diagnostics.cxx')
-rw-r--r--bpkg/diagnostics.cxx25
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");