Turning on debug logging got slightly more complicated is also much more flexible.
| sqlpp11 | sqlpp23 |
|---|---|
|
Turn off logging | |
config->debug = false; |
config->debug = {}; |
|
Turn on logging (all messages to stderr) | |
config->debug = true; |
constexpr auto log_cerr =
[](const std::string& message) {
std::cerr << message << '\n';
};
// ...
config->debug = sqlpp::debug_logger{
{sqlpp::log_category::all},
log_cerr}; |
|
Turn on logging (some messages to clog) | |
// Not possible. |
constexpr auto log_clog =
[](const std::string& message) {
std::clog << message << '\n';
};
// ...
// Log messages about statements and their
// parameters to std::clog.
config->debug = sqlpp::debug_logger{
{sqlpp::log_category::statement,
sqlpp::log_category::parameter},
log_clog}; |
|
Turn off logging at compile time | |
// Not possible. |
// Before including sqlpp23/core/debug_logger.h in
// the current compilation unit.
#define SQLPP23_DISABLE_DEBUG |