The engine which creates the log databse and provides access to it. More...
Header: | #include <LogEngine> |
Inherits: |
LogEngine(const QString & driver, const QString & dbName, const QString & hostname = QString( "127.0.0.1" ), const QString & username = QString(), const QString & password = QString(), int maxDBSize = 50000, QObject * parent = 0) | |
~LogEngine() | |
void | clearDatabase() |
QList<DeviceId> | devicesInLogs() const |
void | logAction(const Action & action, Logging::LoggingLevel level = Logging::LoggingLevelInfo, int errorCode = 0) |
QList<LogEntry> | logEntries(const LogFilter & filter = LogFilter()) const |
void | logEvent(const Event & event) |
void | logRuleActionsExecuted(const Rule & rule) |
void | logRuleActiveChanged(const Rule & rule) |
void | logRuleEnabledChanged(const Rule & rule, const bool & enabled) |
void | logRuleExitActionsExecuted(const Rule & rule) |
void | logRuleTriggered(const Rule & rule) |
void | logSystemEvent(const QDateTime & dateTime, bool active, Logging::LoggingLevel level = Logging::LoggingLevelInfo) |
void | removeDeviceLogs(const DeviceId & deviceId) |
void | removeRuleLogs(const RuleId & ruleId) |
void | setMaxLogEntries(int maxLogEntries, int overflow) |
void | logDatabaseUpdated() |
void | logEntryAdded(const LogEntry & logEntry) |
The engine which creates the log databse and provides access to it.
The LogEngine creates a SQLite3 database to stores everything what's happening in the system. The database can be accessed from the API's. To control the size of the database the limit of the databse are 8000 entries.
See also LogEntry, LogFilter, LogsResource, and LoggingHandler.
Constructs the log engine with the given parameters. The Qt Database backend to be used. Depending on the installed Qt modules this can be any of QDB2 QIBASE QMYSQL QOCI QODBC QPSQL QSQLITE QSQLITE2 QTDS. dbName is the name of the database. In case of SQLITE this should contain a file path. The Driver will create the file if required. In case of using a database server like MYSQL, the database must exist on the host given by hostname and be accessible with the given username and password.
Destructs the LogEngine.
Removes all entries from the database. This method will be used for the tests.
[signal]
void LogEngine::logDatabaseUpdated()This signal is emitted when the log database was updated. The log database will be updated when a LogEntry was added or when a device was removed and all corresponding LogEntries were removed from the database.
Returns the list of LogEntries of the database matching the given filter.
See also LogEntry and LogFilter.
[signal]
void LogEngine::logEntryAdded(const LogEntry & logEntry)This signal is emitted when an logEntry was added to the database.
See also LogEntry.