Index: sources/canbus/messagebuilder.cpp =================================================================== diff -u -r48379ed048f0ed52263ae3e042fe3cd076895e32 -r5963f00ffd2c557d3ae06a5deea05032a3a3bd68 --- sources/canbus/messagebuilder.cpp (.../messagebuilder.cpp) (revision 48379ed048f0ed52263ae3e042fe3cd076895e32) +++ sources/canbus/messagebuilder.cpp (.../messagebuilder.cpp) (revision 5963f00ffd2c557d3ae06a5deea05032a3a3bd68) @@ -17,6 +17,7 @@ #include // Project +#include "logger.h" #include "crc.h" #include "format.h" @@ -90,7 +91,7 @@ vPayload += mAction & 0xFF; // low byte } else { QString mHexString = Format::toHexString(vAction, false, eLenMessageIDDigits); - qDebug() << "ERROR :" << tr("Incorrect Action ID '%1'").arg(mHexString); + LOG_ERROR(tr("Incorrect Action ID '%1'").arg(mHexString)); return false; } return true; @@ -118,8 +119,8 @@ } if (vData.length() < len) { QString mHexString = Format::toHexString(vAction, false, eLenMessageIDDigits); - qDebug() << "ERROR :" << tr("Not enough data has been provided for the Message ID '%1'").arg(mHexString); - qDebug() << vData.toHex('.'); + LOG_ERROR(tr("Not enough data has been provided for the Message ID '%1'").arg(mHexString)); + LOG_ERROR(vData.toHex('.')); return false; } vPayload += len; @@ -213,7 +214,7 @@ vMessage.data = getData (mPayload, vMessage.length); vMessage.initialized = true; } else { // Expected Header but got pure data - qDebug() << "ERROR :" << tr("Expected Header, got frame without Sync byte"); + LOG_ERROR(tr("Expected Header, got frame without Sync byte")); printPayload(vPayload, false ,vCan_Id); return false; } @@ -231,9 +232,9 @@ quint8 mExpected = 0; quint8 mBeenRead = 0; if ( ! checkCRC(crcData, mExpected, mBeenRead ) ) { // CRC is always next byte after Data - qDebug() << "ERROR :" << tr("CRC error, expected %1 but got %2") + LOG_ERROR(tr("CRC error, expected %1 but got %2") .arg(Format::toHexString(mExpected, true, eLenCRCDigits)) - .arg(Format::toHexString(mBeenRead, true, eLenCRCDigits)); + .arg(Format::toHexString(mBeenRead, true, eLenCRCDigits))); return false; } }