Mercurial > hg > orthanc
comparison OrthancFramework/Sources/SQLite/Statement.cpp @ 4269:c7bd2f21ccc3
new macro CLOG, and sharing more code between logging engines
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 02 Nov 2020 17:15:57 +0100 |
parents | 0ae2ca210077 |
children | 50b0c69b653a |
comparison
equal
deleted
inserted
replaced
4268:0ae2ca210077 | 4269:c7bd2f21ccc3 |
---|---|
57 # define LOG_CREATE(message); | 57 # define LOG_CREATE(message); |
58 # define LOG_APPLY(message); | 58 # define LOG_APPLY(message); |
59 #else | 59 #else |
60 // Trace logging is enabled in debug builds | 60 // Trace logging is enabled in debug builds |
61 # include "../Logging.h" | 61 # include "../Logging.h" |
62 # define LOG_CREATE(message) TLOG(SQLITE) << "SQLite::Statement create: " << message; | 62 # define LOG_CREATE(message) CLOG(TRACE, SQLITE) << "SQLite::Statement create: " << message; |
63 # define LOG_APPLY(message); // TLOG(SQLITE) << "SQLite::Statement apply: " << message; | 63 # define LOG_APPLY(message); // CLOG(TRACE, SQLITE) << "SQLite::Statement apply: " << message; |
64 #endif | 64 #endif |
65 | 65 |
66 #include "sqlite3.h" | 66 #include "sqlite3.h" |
67 | 67 |
68 #if defined(_MSC_VER) | 68 #if defined(_MSC_VER) |
166 // We don't call CheckError() here because sqlite3_reset() returns | 166 // We don't call CheckError() here because sqlite3_reset() returns |
167 // the last error that Step() caused thereby generating a second | 167 // the last error that Step() caused thereby generating a second |
168 // spurious error callback. | 168 // spurious error callback. |
169 if (clear_bound_vars) | 169 if (clear_bound_vars) |
170 sqlite3_clear_bindings(GetStatement()); | 170 sqlite3_clear_bindings(GetStatement()); |
171 //TLOG(SQLITE) << "SQLite::Statement::Reset"; | 171 //CLOG(TRACE, SQLITE) << "SQLite::Statement::Reset"; |
172 sqlite3_reset(GetStatement()); | 172 sqlite3_reset(GetStatement()); |
173 } | 173 } |
174 | 174 |
175 std::string Statement::GetOriginalSQLStatement() | 175 std::string Statement::GetOriginalSQLStatement() |
176 { | 176 { |