SQL/ODBC: use categorized logger
Use the categorized logger qt.sql.odbc Change-Id: I1411e80fa33582857bafdf77baee75b293df56af Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>bb10
parent
1bd755465e
commit
efd26cdb2a
|
|
@ -10,6 +10,7 @@
|
|||
#include <qcoreapplication.h>
|
||||
#include <qdatetime.h>
|
||||
#include <qlist.h>
|
||||
#include <qloggingcategory.h>
|
||||
#include <qmath.h>
|
||||
#include <qsqlerror.h>
|
||||
#include <qsqlfield.h>
|
||||
|
|
@ -26,6 +27,8 @@
|
|||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
static Q_LOGGING_CATEGORY(lcOdbc, "qt.sql.odbc")
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
// non-standard ODBC SQL data type from SQL Server sometimes used instead of SQL_TIME
|
||||
|
|
@ -321,9 +324,9 @@ static void qSqlWarning(const QString &message, T &&val)
|
|||
{
|
||||
const auto addMsg = errorStringFromDiagRecords(qODBCWarn(val));
|
||||
if (addMsg.isEmpty())
|
||||
qWarning() << message;
|
||||
qCWarning(lcOdbc) << message;
|
||||
else
|
||||
qWarning() << message << "\tError:" << addMsg;
|
||||
qCWarning(lcOdbc) << message << "\tError:" << addMsg;
|
||||
}
|
||||
|
||||
static QSqlError qMakeError(const QString &err,
|
||||
|
|
|
|||
Loading…
Reference in New Issue