[odb-users] Custom tracer
david bowe
dpbowe at hotmail.com
Thu Feb 23 04:34:40 EST 2017
Hi there,
I am implementing a custom tracer to log odb querys in a file using the given example in the manual.
However, when adding the custom tracer through the db pointer I am told I am not able to access the tracer odb::tracer class. The compiler gives the following error.
src/db-driver.cxx:68:21: error: ‘odb::tracer’ is an inaccessible base of ‘pgsql_tracer’
db->tracer (tracer);
^
Any help would be gratefully appreciated [😡]
The following is my database connection function
void Database::connectDatabase() {
const std::string username = "user";
const std::string password = "pass";
const std::string database = "database";
const std::string host = "localhost";
const unsigned int port = 5432;
try {
pgsql_tracer tracer;
db.reset(new odb::pgsql::database (username, password, database, host, port));
db->tracer (tracer);
} catch (odb::exception& e) {
FILE_LOG(logERROR) << e.what();
exit(1);
}
}
Thanks,
David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: =?utf-8?B?T3V0bG9va0Vtb2ppLfCfmKEucG5n?=
Type: image/png
Size: 461 bytes
Desc: =?utf-8?B?T3V0bG9va0Vtb2ppLfCfmKEucG5n?=
Url : http://codesynthesis.com/pipermail/odb-users/attachments/20170223/1769f95f/utf-8BT3V0bG9va0Vtb2ppLfCfmKEucG5n.png
More information about the odb-users
mailing list