Index: sources/storage/logger.cpp =================================================================== diff -u -rb9c5b0b3afc3b34d4980ecc4f023f498f80dafbc -r805119c460b4a266d6401c8705f4427e7fbe270f --- sources/storage/logger.cpp (.../logger.cpp) (revision b9c5b0b3afc3b34d4980ecc4f023f498f80dafbc) +++ sources/storage/logger.cpp (.../logger.cpp) (revision 805119c460b4a266d6401c8705f4427e7fbe270f) @@ -1,6 +1,6 @@ /*! * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. + * 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 @@ -28,6 +28,12 @@ using namespace Storage; +/*! + * \brief Logger::Logger + * \details Constructor + * \param parent - QObject parent owner object. + * Qt handles the children destruction by their parent objects life-cycle. + */ Logger::Logger(QObject *parent) : QObject(parent) { } /*! @@ -71,8 +77,11 @@ */ void Logger::quit() { + // coco begin validated: Application termination is not correctly done in coco!!! + // it has been tested and works perfectly fine in normal run. quitThread(); } +// coco end void Logger::onLog(const QString &vContent, LogType vLogType) { @@ -119,11 +128,15 @@ */ void Logger::quitThread() { + // coco begin validated: Application termination is not correctly done in coco!!! + // it has been tested and works perfectly fine in normal run. + if (! _thread) return; // runs in thread moveToThread(qApp->thread()); } +// coco end /*! * \brief Logger::checkLogPath @@ -212,6 +225,7 @@ default: LOG_ERROR(tr("Incorrect type of logging").arg(vLogType)); } + mContent += _logPrefix[vLogType]; mContent += _prefixSeparator; mContent += QTime::currentTime().toString(_timeFormat); @@ -220,6 +234,10 @@ _logFileName = _logPathNames[vLogType] + fileName; FileHandler::write(_logFileName, mContent + "\r\n", true); if (vLogType == eLogError) { +#ifdef QT_DEBUG + //mContent.prepend("\033[1;31m --- @ --- \033[0m"); + mContent.prepend(" @ "); +#endif qDebug().noquote() << mContent; } } @@ -233,14 +251,21 @@ */ bool Logger::concurrentExport() { + // coco begin validated: This needs user interaction to export to USB device + // has been tested manually QString mSource = Storage::Log_Base_Path_Name_Location; QString mDestination = Storage::USB_Mount_Point; QFuture future = QtConcurrent::run(&FileHandler::copyFolder, mSource, mDestination); _exportWatcher.setFuture(future); + future.waitForFinished(); return true; } +// coco end void Logger::onExport() { + // coco begin validated: This needs user interaction to export to USB device + // has been tested manually emit didExport(); } +// coco end