aboutsummaryrefslogtreecommitdiff
path: root/odb/tracer.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/tracer.cxx')
-rw-r--r--odb/tracer.cxx30
1 files changed, 29 insertions, 1 deletions
diff --git a/odb/tracer.cxx b/odb/tracer.cxx
index 6a617f4..ec79033 100644
--- a/odb/tracer.cxx
+++ b/odb/tracer.cxx
@@ -42,27 +42,55 @@ namespace odb
class stderr_tracer_type: public tracer
{
+ public:
+ stderr_tracer_type (bool full): full_ (full) {}
+
+ virtual void
+ prepare (connection&, const statement&);
+
virtual void
execute (connection&, const char* statement);
+ virtual void
+ deallocate (connection&, const statement&);
+
// Override the other version to get rid of a Sun CC warning.
//
virtual void
execute (connection&, const statement&);
+
+ private:
+ bool full_;
};
void stderr_tracer_type::
+ prepare (connection&, const statement& s)
+ {
+ if (full_)
+ cerr << "PREPARE " << s.text () << endl;
+ }
+
+ void stderr_tracer_type::
execute (connection&, const char* s)
{
cerr << s << endl;
}
void stderr_tracer_type::
+ deallocate (connection&, const statement& s)
+ {
+ if (full_)
+ cerr << "DEALLOCATE " << s.text () << endl;
+ }
+
+ void stderr_tracer_type::
execute (connection& c, const statement& s)
{
execute (c, s.text ());
}
- static stderr_tracer_type stderr_tracer_;
+ static stderr_tracer_type stderr_tracer_ (false);
+ static stderr_tracer_type stderr_full_tracer_ (true);
tracer& stderr_tracer = stderr_tracer_;
+ tracer& stderr_full_tracer = stderr_full_tracer_;
}