本文整理汇总了C++中LogEntry::active方法的典型用法代码示例。如果您正苦于以下问题:C++ LogEntry::active方法的具体用法?C++ LogEntry::active怎么用?C++ LogEntry::active使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LogEntry
的用法示例。
在下文中一共展示了LogEntry::active方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: appendLogEntry
void LogEngine::appendLogEntry(const LogEntry &entry)
{
QString queryString = QString("INSERT INTO entries (timestamp, loggingEventType, loggingLevel, sourceType, typeId, deviceId, value, active, errorCode) values ('%1', '%2', '%3', '%4', '%5', '%6', '%7', '%8', '%9');")
.arg(entry.timestamp().toMSecsSinceEpoch())
.arg(entry.eventType())
.arg(entry.level())
.arg(entry.source())
.arg(entry.typeId().toString())
.arg(entry.deviceId().toString())
.arg(entry.value())
.arg(entry.active())
.arg(entry.errorCode());
QSqlQuery query;
query.exec(queryString);
if (query.lastError().isValid()) {
qCWarning(dcLogEngine) << "Error writing log entry. Driver error:" << query.lastError().driverText() << "Database error:" << query.lastError().databaseText();
}
}
示例2: appendLogEntry
void LogEngine::appendLogEntry(const LogEntry &entry)
{
checkDBSize();
QString queryString = QString("INSERT INTO entries (timestamp, loggingEventType, loggingLevel, sourceType, typeId, deviceId, value, active, errorCode) values ('%1', '%2', '%3', '%4', '%5', '%6', '%7', '%8', '%9');")
.arg(entry.timestamp().toTime_t())
.arg(entry.eventType())
.arg(entry.level())
.arg(entry.source())
.arg(entry.typeId().toString())
.arg(entry.deviceId().toString())
.arg(entry.value())
.arg(entry.active())
.arg(entry.errorCode());
QSqlQuery query;
if (!query.exec(queryString)) {
qCWarning(dcLogEngine) << "Error writing log entry. Driver error:" << query.lastError().driverText() << "Database error:" << query.lastError().databaseText();
qCWarning(dcLogEngine) << entry;
return;
}
emit logEntryAdded(entry);
}