Index: sources/storage/logger.cpp =================================================================== diff -u -red85c796c2e3bd73aeda374d9a109750bd7732e3 -r56e378f7504701b9e9a9dccaf205aef2fd52c58e --- sources/storage/logger.cpp (.../logger.cpp) (revision ed85c796c2e3bd73aeda374d9a109750bd7732e3) +++ sources/storage/logger.cpp (.../logger.cpp) (revision 56e378f7504701b9e9a9dccaf205aef2fd52c58e) @@ -1,14 +1,15 @@ /*! * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. - * \copyright \n - * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n - * IN PART OR IN WHOLE, \n - * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * - * \file logger.cpp - * \date 2019/09/30 - * \author Behrouz NematiPour + * \file logger.cpp + * \author (last) Behrouz NematiPour + * \date (last) 20-Aug-2020 + * \author (original) Behrouz NematiPour + * \date (original) 24-Sep-2019 * */ #include "logger.h" @@ -164,7 +165,7 @@ void Logger::checkLogPath() { setLogBasePath(); // try to use /media/sd_card on device - // coco begin validated: It can only happen if the file system is readonly for any reson. + // coco begin validated: It can only happen if the file system is readonly for any reason. // it has been tested and works perfectly fine in normal run. if (! setLogPath()) { // check and create log folders & if unsuccessful then // coco end @@ -200,11 +201,13 @@ bool Logger::setLogPath() { bool ok = true; + // coco begin validated: Has been tested manually, this needs user interaction to check the file system if ( ok && ! setLogPath(LogType::eLogDebug) ) ok = false; if ( ok && ! setLogPath(LogType::eLogEvent) ) ok = false; if ( ok && ! setLogPath(LogType::eLogDatum) ) ok = false; return ok; } +// coco end /*! * \brief Logger::setLogPath @@ -218,7 +221,7 @@ bool ok = false; switch (vLogType) { case LogType::eLogDebug: - _logPathNames[vLogType] = qApp->applicationDirPath() + "/" + _logBasePathNames[vLogType]; + _logPathNames[vLogType] = _dir.path() + "/" + _logBasePathNames[vLogType]; break; default: @@ -279,6 +282,8 @@ bool Logger::exportLogs() { + // coco begin validated: This needs user interaction to check the old files deleted + // has been tested manually int result = 0; static QString mOSource; QString mDestination = USB_Mount_Point; @@ -293,6 +298,7 @@ mOSource = ""; return result >= 0; // refer to QProcess::execute(hit F1 on execute) doc. } +// coco end /*! * \brief Logger::concurrentExportLogs @@ -346,7 +352,7 @@ countRemoved += FileHandler::removeFiles({ mCSource }, mLogFileFilter, mOlderThan); } else { - LOG_DEBUG("Current day logs cannot be deletet"); + LOG_DEBUG("Current day logs cannot be deleted"); } } } @@ -383,12 +389,11 @@ void Logger::onSDCardSpaceChange(bool vReady, qint64 vTotal, qint64 vAvailable, quint8 vPercent) { + Q_UNUSED(vTotal ) + Q_UNUSED(vAvailable ) + if ( ! vReady ) return; if (vPercent < _availableSpacePercent ) { concurrentRemoveLogs(); - qDebug() << 0 << vReady << vTotal << vAvailable << vPercent; } - else { - qDebug() << 1 << vReady << vTotal << vAvailable << vPercent; - } } // coco end