Index: sources/storage/Logger.h =================================================================== diff -u -raccc25a2cefe436401ad04c57713cfa410621317 -re6ddf6840cdd5a09deaac1dcdcd7d70064dc6a09 --- sources/storage/Logger.h (.../Logger.h) (revision accc25a2cefe436401ad04c57713cfa410621317) +++ sources/storage/Logger.h (.../Logger.h) (revision e6ddf6840cdd5a09deaac1dcdcd7d70064dc6a09) @@ -18,6 +18,7 @@ #include #include #include +#include // Project #include "main.h" // Doxygen : do not remove @@ -121,12 +122,14 @@ const char *_headerA = "TimeStamp,ID,SubSys,Name,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40"; const char *_headerD = "TimeStamp,Description"; - const quint16 _cachetimeout = 5 ; // 5 seconds timeout until flushes, for slow traffics - quint16 _cacheCounter = _cachetimeout ; // 5 seconds timeout counter - quint16 _cacheCount = 2000; // 2K message count - CacheIndex _cacheIndex = eCache1; + const quint16 _cachetimeout = 5 ; // seconds timeout until flushes, for slow traffics + quint16 _cacheCounter = _cachetimeout ; // seconds timeout counter + quint16 _cacheCount = 3000 ; // K message count + QAtomicInt _cacheIndex = eCache1; QStringList _cacheA[eCacheIndexCount]; QStringList _cacheD[eCacheIndexCount]; + QElapsedTimer _flushElapsedA; + QElapsedTimer _flushElapsedD; QDir _dir; @@ -206,7 +209,8 @@ LogType _exportLogsType = eLogNone; QFutureWatcher _exportLogsWatcher; QFutureWatcher _removeLogsWatcher; - QFutureWatcher _flushLogsWatcher; + QFutureWatcher _flushLogsWatcherA; + QFutureWatcher _flushLogsWatcherD; QThread *_thread = nullptr; bool _init = false; @@ -327,7 +331,8 @@ * \details notification of the floush log * \param vInProgress */ - void didFlushLogs(bool vInProgress); + void didFlushLogsA(bool vInProgress); + void didFlushLogsD(bool vInProgress); // ----- Available space is low private slots: @@ -339,11 +344,13 @@ // ----- logging structure private slots: void onLog (const QString &vContent, LogType vLogType, bool vTimestamp); - bool concurrentFlushLog ( LogType vLogType); - void onFlushLogs(); + bool concurrentFlushLogA(); + bool concurrentFlushLogD(); + void onFlushLogsA(); + void onFlushLogsD(); private: bool logOverflow (LogType vLogType); - CacheIndex logSwitch (); + int logSwitch (); void logTimeout (); void log (const QString &vContent, LogType vLogType); int flush ( LogType vLogType);