comparison OrthancFramework/Sources/SQLite/Statement.cpp @ 4268:0ae2ca210077

new macro TLOG() to replace VLOG() for trace logs with a category
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 02 Nov 2020 14:48:15 +0100
parents d25f4c0fa160
children c7bd2f21ccc3
comparison
equal deleted inserted replaced
4267:a20928107a90 4268:0ae2ca210077
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) VLOG(1) << "SQLite::Statement create: " << message; 62 # define LOG_CREATE(message) TLOG(SQLITE) << "SQLite::Statement create: " << message;
63 # define LOG_APPLY(message); // VLOG(1) << "SQLite::Statement apply: " << message; 63 # define LOG_APPLY(message); // TLOG(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 //VLOG(1) << "SQLite::Statement::Reset"; 171 //TLOG(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 {