[Libpqxx-general] set libpqxx to --quiet or very quiet?

Jeroen Vermeulen jtv at xs4all.nl
Sat Sep 26 11:03:43 UTC 2009


Caleb Cushing wrote:
> how do I make it so that connections to postgres aren't sending lots
> of data to stdout? I'd like to set it so it only prints errors and
> more data when I enable some debug level..

Override the noticer on your connection with a quiet one.  For example, 
the nonnoticer type prints nothing at all:

     std::auto_ptr<pqxx::noticer> quiet(new pqxx::nonnoticer());
     conn.set_noticer(quiet);

Now the only errors you'll get are C++ exceptions, which it's up to you 
to catch and display.


Jeroen


More information about the Libpqxx-general mailing list