Index: sources/storage/Logger.cpp =================================================================== diff -u -r12e7b6dda53cf8db7707c7fa55dcf6137e7d6997 -rc8b2c06141831ba2908323138d94dec0ccc0d402 --- sources/storage/Logger.cpp (.../Logger.cpp) (revision 12e7b6dda53cf8db7707c7fa55dcf6137e7d6997) +++ sources/storage/Logger.cpp (.../Logger.cpp) (revision c8b2c06141831ba2908323138d94dec0ccc0d402) @@ -7,9 +7,9 @@ * * \file Logger.cpp * \author (last) Behrouz NematiPour - * \date (last) 20-Aug-2020 + * \date (last) 08-Sep-2020 * \author (original) Behrouz NematiPour - * \date (original) 24-Sep-2019 + * \date (original) 26-Aug-2020 * */ #include "Logger.h" @@ -106,7 +106,6 @@ connect(this, SIGNAL(didLog(QString,LogType)), this, SLOT( onLog(QString,LogType))); - connect(&_MainTimer, SIGNAL( didDateChange ()), this , SLOT( concurrentRemoveLogs())); @@ -270,13 +269,11 @@ logPathName = _logPathNames[eLogDebug]; _logFileName = logPathName + fileName; FileHandler::write(_logFileName, mContent + "\r\n", true); - if (vLogType == eLogDebug) { -#ifdef QT_DEBUG - //mContent.prepend("\033[1;31m --- @ --- \033[0m"); - mContent.prepend(" @ "); -#endif + // coco begin validated: This code is only for debugging purposes and had been tested manually. + if (_enableConsoleOut) { qDebug().noquote() << mContent; } + // coco end } /*! @@ -422,3 +419,20 @@ } } // coco end + +/*! + * \brief Logger::enableConsoleOut + * \details Enables or Disables the console output and logs the status + * \param vEnabled - Enable console output if true + */ +void Logger::enableConsoleOut(bool vEnabled) { + // coco begin validated: This code meant to be used only for debugging and tested manually + if (_enableConsoleOut == vEnabled) return; + _enableConsoleOut = vEnabled; + if (_enableConsoleOut) { + LOG_DEBUG("Console out Logging enabled"); + } else { + LOG_DEBUG("Console out Logging disabled"); + } +} +// coco end