Index: sources/canbus/caninterface.cpp =================================================================== diff -u -r44a85c96ab55e424866ec4cca0270aa218355f82 -rd2035a8728794afeefaa244bf8d1597926d945f5 --- sources/canbus/caninterface.cpp (.../caninterface.cpp) (revision 44a85c96ab55e424866ec4cca0270aa218355f82) +++ sources/canbus/caninterface.cpp (.../caninterface.cpp) (revision d2035a8728794afeefaa244bf8d1597926d945f5) @@ -55,8 +55,10 @@ initConnections(); status(tr("Connected")); - LOG_EVENT(status()); - LOG_EVENT(QObject::tr("%1 Initialized").arg(metaObject()->className())); + QString logMessage = QString("UI,%1,%2") + .arg(tr("%1 Initialized").arg(metaObject()->className())) + .arg(status()); + LOG_EVENT(logMessage); return true; } @@ -102,6 +104,23 @@ } /*! + * \brief CanInterface::enableConsoleOut + * \details Enable or Disables the console output and logs the status + * \param vEnabled - Enalbe console output if true + */ +void CanInterface::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 CanInterface enabled"); + } else { + LOG_DEBUG("Console out CanInterface disabled"); + } +} +// coco end + +/*! * \brief CanInterface connections definition * \details Initializes the required signal/slot connection between this class and other objects * to be able to communicate. @@ -171,7 +190,7 @@ // coco begin validated: Manually tested since required to disable and enable the canbus if (!_canDevice) { status(tr("Device Creation"), mError); - LOG_ERROR(status()); + LOG_DEBUG(status()); return false; } // coco end @@ -187,7 +206,7 @@ { if (!_canDevice->connectDevice()) { status(tr("Connection")); - LOG_ERROR(status()); + LOG_DEBUG(status()); delete _canDevice; _canDevice = nullptr; return false; @@ -258,8 +277,6 @@ // coco begin validated: This code is only for debugging purposes and had been tested manually. if ( ! _enableConsoleOut ) return; - LOG_EVENT_ONCE(QObject::tr("console out CanInterface Enabled")); - const QString time = QString::fromLatin1("%1.%2 ") .arg(vFrame.timeStamp().seconds(), 10, 10, QLatin1Char(' ')) .arg(vFrame.timeStamp().microSeconds() / 100, 4, 10, QLatin1Char('0')); @@ -351,7 +368,7 @@ case QCanBusDevice::ConfigurationError: case QCanBusDevice::UnknownError: _canStatus = _canDevice->errorString(); - LOG_ERROR(QString("%1 - %2").arg(_erFrameCount).arg(_canStatus)); + LOG_DEBUG(QString("%1 - %2").arg(_erFrameCount).arg(_canStatus)); break; default: