From b45b6b37580cbe6a3acae6a958c7ccdd7e1fa184 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 9 May 2022 00:25:48 +0200 Subject: [PATCH] replace FLOG with LOG variants --- .../devicehandlers/MgmLIS3MDLHandler.cpp | 2 +- hal/src/fsfw_hal/linux/CommandExecutor.cpp | 2 +- hal/src/fsfw_hal/linux/i2c/I2cComIF.cpp | 36 ++++++------ hal/src/fsfw_hal/linux/spi/SpiComIF.cpp | 22 ++++---- hal/src/fsfw_hal/linux/uart/UartComIF.cpp | 55 +++++++++---------- src/fsfw/action/ActionHelper.cpp | 6 +- src/fsfw/cfdp/CFDPHandler.cpp | 2 +- src/fsfw/cfdp/pdu/EofPduDeserializer.cpp | 6 +- src/fsfw/cfdp/pdu/VarLenField.cpp | 2 +- src/fsfw/cfdp/tlv/FilestoreTlvBase.h | 2 +- src/fsfw/datapool/PoolDataSetBase.cpp | 8 +-- src/fsfw/datapool/PoolEntry.cpp | 2 +- src/fsfw/datapool/PoolReadGuard.h | 2 +- src/fsfw/datapoollocal/HasLocalDataPoolIF.h | 2 +- .../datapoollocal/LocalDataPoolManager.cpp | 6 +- .../datapoollocal/LocalPoolDataSetBase.cpp | 4 +- .../datapoollocal/LocalPoolObjectBase.cpp | 12 ++-- src/fsfw/datapoollocal/LocalPoolVector.tpp | 4 +- src/fsfw/devicehandlers/DeviceHandlerBase.cpp | 26 ++++----- .../DeviceHandlerFailureIsolation.cpp | 2 +- src/fsfw/events/EventManagerIF.h | 2 +- src/fsfw/fdir/FailureIsolationBase.cpp | 9 ++- src/fsfw/globalfunctions/arrayprinter.cpp | 4 +- src/fsfw/health/HealthHelper.cpp | 10 ++-- src/fsfw/health/HealthTable.cpp | 2 +- src/fsfw/ipc/MessageQueueMessage.cpp | 2 +- src/fsfw/memory/MemoryHelper.cpp | 2 +- .../monitoring/MonitoringMessageContent.h | 2 +- src/fsfw/objectmanager/ObjectManager.cpp | 20 +++---- src/fsfw/osal/common/TcpTmTcServer.cpp | 2 +- src/fsfw/osal/common/tcpipCommon.cpp | 6 +- src/fsfw/osal/host/FixedTimeslotTask.cpp | 2 +- src/fsfw/osal/linux/tcpipHelpers.cpp | 2 +- src/fsfw/parameters/ParameterHelper.cpp | 6 +- src/fsfw/parameters/ParameterWrapper.cpp | 8 +-- src/fsfw/pus/Service20ParameterManagement.cpp | 4 +- src/fsfw/pus/Service2DeviceAccess.cpp | 6 +- src/fsfw/pus/Service3Housekeeping.cpp | 2 +- src/fsfw/serialize/SerialBufferAdapter.cpp | 4 +- src/fsfw/serviceinterface/fmtWrapper.h | 17 ------ .../storagemanager/ConstStorageAccessor.cpp | 4 +- src/fsfw/storagemanager/LocalPool.cpp | 10 ++-- src/fsfw/storagemanager/StorageAccessor.cpp | 2 +- src/fsfw/tasks/FixedSlotSequence.cpp | 10 ++-- src/fsfw/tcdistribution/CCSDSDistributor.cpp | 2 +- src/fsfw/tcdistribution/CFDPDistributor.cpp | 15 +++-- src/fsfw/tcdistribution/PUSDistributor.cpp | 2 +- src/fsfw/tcdistribution/TcDistributor.cpp | 4 +- src/fsfw/timemanager/Stopwatch.cpp | 6 +- src/fsfw/tmtcpacket/SpacePacketBase.cpp | 2 +- src/fsfw/tmtcpacket/cfdp/CFDPPacket.cpp | 2 +- .../tmtcpacket/pus/tm/TmPacketStoredBase.cpp | 8 +-- .../tmtcservices/CommandingServiceBase.cpp | 2 +- src/fsfw/tmtcservices/PusServiceBase.cpp | 8 +-- src/fsfw/tmtcservices/TmTcBridge.cpp | 4 +- .../tmtcservices/VerificationReporter.cpp | 8 +-- .../integration/devices/TestDeviceHandler.cpp | 14 ++--- .../fsfw_tests/internal/UnittDefinitions.cpp | 2 +- 58 files changed, 200 insertions(+), 220 deletions(-) diff --git a/hal/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.cpp b/hal/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.cpp index ff501368..251b73a8 100644 --- a/hal/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.cpp +++ b/hal/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.cpp @@ -199,7 +199,7 @@ ReturnValue_t MgmLIS3MDLHandler::scanForReply(const uint8_t *start, size_t len, *foundId = getPendingCommand(); if (*foundId == MGMLIS3MDL::IDENTIFY_DEVICE) { if (start[1] != MGMLIS3MDL::DEVICE_ID) { - FSFW_FLOGW( + FSFW_LOGW( "scanForReply: Device identification failed, found ID {} not equal to expected {}\n", start[1], MGMLIS3MDL::DEVICE_ID); return DeviceHandlerIF::INVALID_DATA; diff --git a/hal/src/fsfw_hal/linux/CommandExecutor.cpp b/hal/src/fsfw_hal/linux/CommandExecutor.cpp index 539bb351..63b3e30b 100644 --- a/hal/src/fsfw_hal/linux/CommandExecutor.cpp +++ b/hal/src/fsfw_hal/linux/CommandExecutor.cpp @@ -61,7 +61,7 @@ ReturnValue_t CommandExecutor::close() { void CommandExecutor::printLastError(const std::string& funcName) const { if (lastError != 0) { - FSFW_FLOGW("{} | pclose failed with code {} | {}\n", funcName, lastError, strerror(lastError)); + FSFW_LOGW("{} | pclose failed with code {} | {}\n", funcName, lastError, strerror(lastError)); } } diff --git a/hal/src/fsfw_hal/linux/i2c/I2cComIF.cpp b/hal/src/fsfw_hal/linux/i2c/I2cComIF.cpp index 01d19c85..a509dad1 100644 --- a/hal/src/fsfw_hal/linux/i2c/I2cComIF.cpp +++ b/hal/src/fsfw_hal/linux/i2c/I2cComIF.cpp @@ -26,7 +26,7 @@ ReturnValue_t I2cComIF::initializeInterface(CookieIF* cookie) { std::string deviceFile; if (cookie == nullptr) { - FSFW_FLOGE("{}", "initializeInterface: Invalid cookie\n"); + FSFW_LOGE("{}", "initializeInterface: Invalid cookie\n"); return NULLPOINTER; } auto* i2cCookie = dynamic_cast(cookie); @@ -38,14 +38,14 @@ ReturnValue_t I2cComIF::initializeInterface(CookieIF* cookie) { I2cInstance i2cInstance = {std::vector(maxReplyLen), 0}; auto statusPair = i2cDeviceMap.emplace(i2cAddress, i2cInstance); if (not statusPair.second) { - FSFW_FLOGW("initializeInterface: Failed to insert device with address {} to I2C device map\n", - i2cAddress); + FSFW_LOGW("initializeInterface: Failed to insert device with address {} to I2C device map\n", + i2cAddress); return HasReturnvaluesIF::RETURN_FAILED; } return HasReturnvaluesIF::RETURN_OK; } - FSFW_FLOGE("initializeInterface: Device with address {} already in use\n", i2cAddress); + FSFW_LOGE("initializeInterface: Device with address {} already in use\n", i2cAddress); return HasReturnvaluesIF::RETURN_FAILED; } @@ -55,7 +55,7 @@ ReturnValue_t I2cComIF::sendMessage(CookieIF* cookie, const uint8_t* sendData, s std::string deviceFile; if (sendData == nullptr) { - FSFW_FLOGW("{}", "sendMessage: Send Data is nullptr\n"); + FSFW_LOGW("{}", "sendMessage: Send Data is nullptr\n"); return HasReturnvaluesIF::RETURN_FAILED; } @@ -65,14 +65,14 @@ ReturnValue_t I2cComIF::sendMessage(CookieIF* cookie, const uint8_t* sendData, s auto* i2cCookie = dynamic_cast(cookie); if (i2cCookie == nullptr) { - FSFW_FLOGWT("{}", "sendMessage: Invalid I2C Cookie\n"); + FSFW_LOGWT("{}", "sendMessage: Invalid I2C Cookie\n"); return NULLPOINTER; } address_t i2cAddress = i2cCookie->getAddress(); i2cDeviceMapIter = i2cDeviceMap.find(i2cAddress); if (i2cDeviceMapIter == i2cDeviceMap.end()) { - FSFW_FLOGWT("{}", "sendMessage: I2C address of cookie not registered in I2C device map\n"); + FSFW_LOGWT("{}", "sendMessage: I2C address of cookie not registered in I2C device map\n"); return HasReturnvaluesIF::RETURN_FAILED; } @@ -87,8 +87,8 @@ ReturnValue_t I2cComIF::sendMessage(CookieIF* cookie, const uint8_t* sendData, s } if (write(fd, sendData, sendLen) != static_cast(sendLen)) { - FSFW_FLOGE("sendMessage: Failed to send data to I2C device with error code {} | {}\n", errno, - strerror(errno)); + FSFW_LOGE("sendMessage: Failed to send data to I2C device with error code {} | {}\n", errno, + strerror(errno)); return HasReturnvaluesIF::RETURN_FAILED; } @@ -112,7 +112,7 @@ ReturnValue_t I2cComIF::requestReceiveMessage(CookieIF* cookie, size_t requestLe auto* i2cCookie = dynamic_cast(cookie); if (i2cCookie == nullptr) { - FSFW_FLOGWT("{}", "requestReceiveMessage: Invalid I2C Cookie\n"); + FSFW_LOGWT("{}", "requestReceiveMessage: Invalid I2C Cookie\n"); i2cDeviceMapIter->second.replyLen = 0; return NULLPOINTER; } @@ -120,8 +120,8 @@ ReturnValue_t I2cComIF::requestReceiveMessage(CookieIF* cookie, size_t requestLe address_t i2cAddress = i2cCookie->getAddress(); i2cDeviceMapIter = i2cDeviceMap.find(i2cAddress); if (i2cDeviceMapIter == i2cDeviceMap.end()) { - FSFW_FLOGW("requestReceiveMessage: I2C address {} of Cookie not registered in i2cDeviceMap", - i2cAddress); + FSFW_LOGW("requestReceiveMessage: I2C address {} of Cookie not registered in i2cDeviceMap", + i2cAddress); i2cDeviceMapIter->second.replyLen = 0; return HasReturnvaluesIF::RETURN_FAILED; } @@ -141,7 +141,7 @@ ReturnValue_t I2cComIF::requestReceiveMessage(CookieIF* cookie, size_t requestLe ssize_t readLen = read(fd, replyBuffer, requestLen); if (readLen != static_cast(requestLen)) { - FSFW_FLOGWT( + FSFW_LOGWT( "requestReceiveMessage: Reading from I2C device failed with error code " "{} | {}\nRead only {} from {} bytes\n", errno, strerror(errno), readLen, requestLen); @@ -161,15 +161,15 @@ ReturnValue_t I2cComIF::requestReceiveMessage(CookieIF* cookie, size_t requestLe ReturnValue_t I2cComIF::readReceivedMessage(CookieIF* cookie, uint8_t** buffer, size_t* size) { auto* i2cCookie = dynamic_cast(cookie); if (i2cCookie == nullptr) { - FSFW_FLOGW("{}", "readReceivedMessage: Invalid I2C Cookie\n"); + FSFW_LOGW("{}", "readReceivedMessage: Invalid I2C Cookie\n"); return NULLPOINTER; } address_t i2cAddress = i2cCookie->getAddress(); i2cDeviceMapIter = i2cDeviceMap.find(i2cAddress); if (i2cDeviceMapIter == i2cDeviceMap.end()) { - FSFW_FLOGE("readReceivedMessage: I2C address {} of cookie not found in I2C device map\n", - i2cAddress); + FSFW_LOGE("readReceivedMessage: I2C address {} of cookie not found in I2C device map\n", + i2cAddress); return HasReturnvaluesIF::RETURN_FAILED; } *buffer = i2cDeviceMapIter->second.replyBuffer.data(); @@ -181,8 +181,8 @@ ReturnValue_t I2cComIF::readReceivedMessage(CookieIF* cookie, uint8_t** buffer, ReturnValue_t I2cComIF::openDevice(std::string deviceFile, address_t i2cAddress, int* fileDescriptor) { if (ioctl(*fileDescriptor, I2C_SLAVE, i2cAddress) < 0) { - FSFW_FLOGWT("openDevice: Specifying target device failed with error code {} | {}\n", errno, - strerror(errno)); + FSFW_LOGWT("openDevice: Specifying target device failed with error code {} | {}\n", errno, + strerror(errno)); return HasReturnvaluesIF::RETURN_FAILED; } return HasReturnvaluesIF::RETURN_OK; diff --git a/hal/src/fsfw_hal/linux/spi/SpiComIF.cpp b/hal/src/fsfw_hal/linux/spi/SpiComIF.cpp index 51ee797c..e98b9de8 100644 --- a/hal/src/fsfw_hal/linux/spi/SpiComIF.cpp +++ b/hal/src/fsfw_hal/linux/spi/SpiComIF.cpp @@ -19,7 +19,7 @@ SpiComIF::SpiComIF(object_id_t objectId, GpioIF* gpioComIF) : SystemObject(objectId), gpioComIF(gpioComIF) { if (gpioComIF == nullptr) { - FSFW_FLOGET("{}", "SpiComIF::SpiComIF: GPIO communication interface invalid\n"); + FSFW_LOGET("{}", "SpiComIF::SpiComIF: GPIO communication interface invalid\n"); } spiMutex = MutexFactory::instance()->createMutex(); @@ -40,7 +40,7 @@ ReturnValue_t SpiComIF::initializeInterface(CookieIF* cookie) { SpiInstance spiInstance(bufferSize); auto statusPair = spiDeviceMap.emplace(spiAddress, spiInstance); if (not statusPair.second) { - FSFW_FLOGWT( + FSFW_LOGWT( "SpiComIF::initializeInterface: Failed to insert device with address {} to SPI device " "map\n", spiAddress); @@ -50,7 +50,7 @@ ReturnValue_t SpiComIF::initializeInterface(CookieIF* cookie) { to the SPI driver transfer struct */ spiCookie->assignReadBuffer(statusPair.first->second.replyBuffer.data()); } else { - FSFW_FLOGWT("{}", "initializeInterface: SPI address already exists\n"); + FSFW_LOGWT("{}", "initializeInterface: SPI address already exists\n"); return HasReturnvaluesIF::RETURN_FAILED; } @@ -123,7 +123,7 @@ ReturnValue_t SpiComIF::sendMessage(CookieIF* cookie, const uint8_t* sendData, s } if (sendLen > spiCookie->getMaxBufferSize()) { - FSFW_FLOGW( + FSFW_LOGW( "sendMessage: Too much data sent, send length {} larger than maximum buffer length {}\n", spiCookie->getMaxBufferSize(), sendLen); return DeviceCommunicationIF::TOO_MUCH_DATA; @@ -173,12 +173,12 @@ ReturnValue_t SpiComIF::performRegularSendOperation(SpiCookie* spiCookie, const if (gpioId != gpio::NO_GPIO) { result = spiMutex->lockMutex(timeoutType, timeoutMs); if (result != RETURN_OK) { - FSFW_FLOGET("{}", "sendMessage: Failed to lock mutex\n"); + FSFW_LOGET("{}", "sendMessage: Failed to lock mutex\n"); return result; } result = gpioComIF->pullLow(gpioId); if (result != HasReturnvaluesIF::RETURN_OK) { - FSFW_FLOGW("{}", "sendMessage: Pulling low CS pin failed\n"); + FSFW_LOGW("{}", "sendMessage: Pulling low CS pin failed\n"); return result; } } @@ -197,7 +197,7 @@ ReturnValue_t SpiComIF::performRegularSendOperation(SpiCookie* spiCookie, const } else { /* We write with a blocking half-duplex transfer here */ if (write(fileDescriptor, sendData, sendLen) != static_cast(sendLen)) { - FSFW_FLOGET("{}", "sendMessage: Half-Duplex write operation failed\n"); + FSFW_LOGET("{}", "sendMessage: Half-Duplex write operation failed\n"); result = HALF_DUPLEX_TRANSFER_FAILED; } } @@ -206,7 +206,7 @@ ReturnValue_t SpiComIF::performRegularSendOperation(SpiCookie* spiCookie, const gpioComIF->pullHigh(gpioId); result = spiMutex->unlockMutex(); if (result != RETURN_OK) { - FSFW_FLOGWT("{}", "sendMessage: Failed to unlock mutex\n"); + FSFW_LOGWT("{}", "sendMessage: Failed to unlock mutex\n"); return result; } } @@ -248,14 +248,14 @@ ReturnValue_t SpiComIF::performHalfDuplexReception(SpiCookie* spiCookie) { if (gpioId != gpio::NO_GPIO) { result = spiMutex->lockMutex(timeoutType, timeoutMs); if (result != RETURN_OK) { - FSFW_FLOGW("{}", "getSendSuccess: Failed to lock mutex\n"); + FSFW_LOGW("{}", "getSendSuccess: Failed to lock mutex\n"); return result; } gpioComIF->pullLow(gpioId); } if (read(fileDescriptor, rxBuf, readSize) != static_cast(readSize)) { - FSFW_FLOGW("{}", "sendMessage: Half-Duplex read operation failed\n"); + FSFW_LOGW("{}", "sendMessage: Half-Duplex read operation failed\n"); result = HALF_DUPLEX_TRANSFER_FAILED; } @@ -263,7 +263,7 @@ ReturnValue_t SpiComIF::performHalfDuplexReception(SpiCookie* spiCookie) { gpioComIF->pullHigh(gpioId); result = spiMutex->unlockMutex(); if (result != RETURN_OK) { - FSFW_FLOGW("{}", "getSendSuccess: Failed to unlock mutex\n"); + FSFW_LOGW("{}", "getSendSuccess: Failed to unlock mutex\n"); return result; } } diff --git a/hal/src/fsfw_hal/linux/uart/UartComIF.cpp b/hal/src/fsfw_hal/linux/uart/UartComIF.cpp index 49d4de76..6f042efa 100644 --- a/hal/src/fsfw_hal/linux/uart/UartComIF.cpp +++ b/hal/src/fsfw_hal/linux/uart/UartComIF.cpp @@ -25,7 +25,7 @@ ReturnValue_t UartComIF::initializeInterface(CookieIF* cookie) { auto* uartCookie = dynamic_cast(cookie); if (uartCookie == nullptr) { - FSFW_FLOGE("{}", "initializeInterface: Invalid UART Cookie\n"); + FSFW_LOGE("{}", "initializeInterface: Invalid UART Cookie\n"); return NULLPOINTER; } @@ -41,12 +41,11 @@ ReturnValue_t UartComIF::initializeInterface(CookieIF* cookie) { UartElements uartElements = {fileDescriptor, std::vector(maxReplyLen), 0}; auto status = uartDeviceMap.emplace(deviceFile, uartElements); if (!status.second) { - FSFW_FLOGW("initializeInterface: Failed to insert device {} to UART device map\n", - deviceFile); + FSFW_LOGW("initializeInterface: Failed to insert device {} to UART device map\n", deviceFile); return RETURN_FAILED; } } else { - FSFW_FLOGW("initializeInterface: UART device {} already in use\n", deviceFile); + FSFW_LOGW("initializeInterface: UART device {} already in use\n", deviceFile); return RETURN_FAILED; } @@ -66,14 +65,14 @@ int UartComIF::configureUartPort(UartCookie* uartCookie) { int fd = open(deviceFile.c_str(), flags); if (fd < 0) { - FSFW_FLOGW("configureUartPort: Failed to open UART {} with error code {} | {}\n", deviceFile, - errno, strerror(errno)); + FSFW_LOGW("configureUartPort: Failed to open UART {} with error code {} | {}\n", deviceFile, + errno, strerror(errno)); return fd; } /* Read in existing settings */ if (tcgetattr(fd, &options) != 0) { - FSFW_FLOGW("configureUartPort: Error {} from tcgetattr: {}\n", errno, strerror(errno)); + FSFW_LOGW("configureUartPort: Error {} from tcgetattr: {}\n", errno, strerror(errno)); return fd; } @@ -94,8 +93,8 @@ int UartComIF::configureUartPort(UartCookie* uartCookie) { /* Save option settings */ if (tcsetattr(fd, TCSANOW, &options) != 0) { - FSFW_FLOGW("configureUartPort: Failed to set options with error {} | {}\n", errno, - strerror(errno)); + FSFW_LOGW("configureUartPort: Failed to set options with error {} | {}\n", errno, + strerror(errno)); return fd; } return fd; @@ -147,8 +146,8 @@ void UartComIF::setDatasizeOptions(struct termios* options, UartCookie* uartCook options->c_cflag |= CS8; break; default: - FSFW_FLOGW("setDatasizeOptions: Invalid size {} specified\n", - static_cast(uartCookie->getBitsPerWord())); + FSFW_LOGW("setDatasizeOptions: Invalid size {} specified\n", + static_cast(uartCookie->getBitsPerWord())); break; } } @@ -301,7 +300,7 @@ void UartComIF::configureBaudrate(struct termios* options, UartCookie* uartCooki break; #endif // ! __APPLE__ default: - FSFW_FLOGW("{}", "UartComIF::configureBaudrate: Baudrate not supported\n"); + FSFW_LOGW("{}", "UartComIF::configureBaudrate: Baudrate not supported\n"); break; } } @@ -316,27 +315,27 @@ ReturnValue_t UartComIF::sendMessage(CookieIF* cookie, const uint8_t* sendData, } if (sendData == nullptr) { - FSFW_FLOGWT("{}", "sendMessage: Send data is nullptr"); + FSFW_LOGWT("{}", "sendMessage: Send data is nullptr"); return RETURN_FAILED; } auto* uartCookie = dynamic_cast(cookie); if (uartCookie == nullptr) { - FSFW_FLOGWT("{}", "sendMessage: Invalid UART Cookie\n"); + FSFW_LOGWT("{}", "sendMessage: Invalid UART Cookie\n"); return NULLPOINTER; } deviceFile = uartCookie->getDeviceFile(); uartDeviceMapIter = uartDeviceMap.find(deviceFile); if (uartDeviceMapIter == uartDeviceMap.end()) { - FSFW_FLOGWT("{}", "sendMessage: Device file {} not in UART map\n", deviceFile); + FSFW_LOGWT("{}", "sendMessage: Device file {} not in UART map\n", deviceFile); return RETURN_FAILED; } fd = uartDeviceMapIter->second.fileDescriptor; if (write(fd, sendData, sendLen) != static_cast(sendLen)) { - FSFW_FLOGE("sendMessage: Failed to send data with error code {} | {}", errno, strerror(errno)); + FSFW_LOGE("sendMessage: Failed to send data with error code {} | {}", errno, strerror(errno)); return RETURN_FAILED; } @@ -351,7 +350,7 @@ ReturnValue_t UartComIF::requestReceiveMessage(CookieIF* cookie, size_t requestL auto* uartCookie = dynamic_cast(cookie); if (uartCookie == nullptr) { - FSFW_FLOGWT("{}", "requestReceiveMessage: Invalid UART Cookie\n"); + FSFW_LOGWT("{}", "requestReceiveMessage: Invalid UART Cookie\n"); return NULLPOINTER; } @@ -364,7 +363,7 @@ ReturnValue_t UartComIF::requestReceiveMessage(CookieIF* cookie, size_t requestL } if (uartDeviceMapIter == uartDeviceMap.end()) { - FSFW_FLOGW("requestReceiveMessage: Device file {} not in UART map\n", deviceFile); + FSFW_LOGW("requestReceiveMessage: Device file {} not in UART map\n", deviceFile); return RETURN_FAILED; } @@ -393,7 +392,7 @@ ReturnValue_t UartComIF::handleCanonicalRead(UartCookie& uartCookie, UartDeviceM if (currentBytesRead >= maxReplySize) { // Overflow risk. Emit warning, trigger event and break. If this happens, // the reception buffer is not large enough or data is not polled often enough. - FSFW_FLOGWT("{}", "requestReceiveMessage: Next read would cause overflow\n"); + FSFW_LOGWT("{}", "requestReceiveMessage: Next read would cause overflow\n"); result = UART_RX_BUFFER_TOO_SMALL; break; } else { @@ -404,7 +403,7 @@ ReturnValue_t UartComIF::handleCanonicalRead(UartCookie& uartCookie, UartDeviceM if (bytesRead < 0) { // EAGAIN: No data available in non-blocking mode if (errno != EAGAIN) { - FSFW_FLOGWT("handleCanonicalRead: read failed with code {} | {}\n", errno, strerror(errno)); + FSFW_LOGWT("handleCanonicalRead: read failed with code {} | {}\n", errno, strerror(errno)); return RETURN_FAILED; } @@ -424,7 +423,7 @@ ReturnValue_t UartComIF::handleNoncanonicalRead(UartCookie& uartCookie, UartDevi auto bufferPtr = iter->second.replyBuffer.data(); // Size check to prevent buffer overflow if (requestLen > uartCookie.getMaxReplyLen()) { - FSFW_FLOGW("{}", "requestReceiveMessage: Next read would cause overflow\n"); + FSFW_LOGW("{}", "requestReceiveMessage: Next read would cause overflow\n"); return UART_RX_BUFFER_TOO_SMALL; } ssize_t bytesRead = read(fd, bufferPtr, requestLen); @@ -432,8 +431,8 @@ ReturnValue_t UartComIF::handleNoncanonicalRead(UartCookie& uartCookie, UartDevi return RETURN_FAILED; } else if (bytesRead != static_cast(requestLen)) { if (uartCookie.isReplySizeFixed()) { - FSFW_FLOGWT("UartComIF::requestReceiveMessage: Only read {} of {} bytes\n", bytesRead, - requestLen); + FSFW_LOGWT("UartComIF::requestReceiveMessage: Only read {} of {} bytes\n", bytesRead, + requestLen); return RETURN_FAILED; } } @@ -447,14 +446,14 @@ ReturnValue_t UartComIF::readReceivedMessage(CookieIF* cookie, uint8_t** buffer, auto* uartCookie = dynamic_cast(cookie); if (uartCookie == nullptr) { - FSFW_FLOGWT("{}", "readReceivedMessage: Invalid uart cookie"); + FSFW_LOGWT("{}", "readReceivedMessage: Invalid uart cookie"); return NULLPOINTER; } deviceFile = uartCookie->getDeviceFile(); uartDeviceMapIter = uartDeviceMap.find(deviceFile); if (uartDeviceMapIter == uartDeviceMap.end()) { - FSFW_FLOGW("UartComIF::readReceivedMessage: Device file {} not in UART map\n", deviceFile); + FSFW_LOGW("UartComIF::readReceivedMessage: Device file {} not in UART map\n", deviceFile); return RETURN_FAILED; } @@ -472,7 +471,7 @@ ReturnValue_t UartComIF::flushUartRxBuffer(CookieIF* cookie) { UartDeviceMapIter uartDeviceMapIter; auto* uartCookie = dynamic_cast(cookie); if (uartCookie == nullptr) { - FSFW_FLOGWT("{}", "flushUartRxBuffer: Invalid UART cookie\n"); + FSFW_LOGWT("{}", "flushUartRxBuffer: Invalid UART cookie\n"); return NULLPOINTER; } deviceFile = uartCookie->getDeviceFile(); @@ -490,7 +489,7 @@ ReturnValue_t UartComIF::flushUartTxBuffer(CookieIF* cookie) { UartDeviceMapIter uartDeviceMapIter; auto* uartCookie = dynamic_cast(cookie); if (uartCookie == nullptr) { - FSFW_FLOGWT("{}", "flushUartTxBuffer: Invalid uart cookie\n"); + FSFW_LOGWT("{}", "flushUartTxBuffer: Invalid uart cookie\n"); return NULLPOINTER; } deviceFile = uartCookie->getDeviceFile(); @@ -508,7 +507,7 @@ ReturnValue_t UartComIF::flushUartTxAndRxBuf(CookieIF* cookie) { UartDeviceMapIter uartDeviceMapIter; auto* uartCookie = dynamic_cast(cookie); if (uartCookie == nullptr) { - FSFW_FLOGWT("{}", "flushUartTxAndRxBuf: Invalid UART cookie\n"); + FSFW_LOGWT("{}", "flushUartTxAndRxBuf: Invalid UART cookie\n"); return NULLPOINTER; } deviceFile = uartCookie->getDeviceFile(); diff --git a/src/fsfw/action/ActionHelper.cpp b/src/fsfw/action/ActionHelper.cpp index e0d57027..13cc6fdc 100644 --- a/src/fsfw/action/ActionHelper.cpp +++ b/src/fsfw/action/ActionHelper.cpp @@ -28,7 +28,7 @@ ReturnValue_t ActionHelper::initialize(MessageQueueIF* queueToUse_) { } if (queueToUse == nullptr) { - FSFW_FLOGW("{}", "initialize: No queue set\n"); + FSFW_LOGW("{}", "initialize: No queue set\n"); return HasReturnvaluesIF::RETURN_FAILED; } @@ -90,7 +90,7 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo, ActionId_t rep size_t size = 0; ReturnValue_t result = ipcStore->getFreeElement(&storeAddress, maxSize, &dataPtr); if (result != HasReturnvaluesIF::RETURN_OK) { - FSFW_FLOGWT("{}", "reportData: Getting free element from IPC store failed\n"); + FSFW_LOGWT("{}", "reportData: Getting free element from IPC store failed\n"); return result; } result = data->serialize(&dataPtr, &size, maxSize, SerializeIF::Endianness::BIG); @@ -125,7 +125,7 @@ ReturnValue_t ActionHelper::reportData(MessageQueueId_t reportTo, ActionId_t rep store_address_t storeAddress; ReturnValue_t result = ipcStore->addData(&storeAddress, data, dataSize); if (result != HasReturnvaluesIF::RETURN_OK) { - FSFW_FLOGWT("{}", "reportData: Adding data to IPC store failed\n"); + FSFW_LOGWT("{}", "reportData: Adding data to IPC store failed\n"); return result; } diff --git a/src/fsfw/cfdp/CFDPHandler.cpp b/src/fsfw/cfdp/CFDPHandler.cpp index 3b2c8eba..7c23c133 100644 --- a/src/fsfw/cfdp/CFDPHandler.cpp +++ b/src/fsfw/cfdp/CFDPHandler.cpp @@ -29,7 +29,7 @@ ReturnValue_t CFDPHandler::initialize() { } ReturnValue_t CFDPHandler::handleRequest(store_address_t storeId) { - FSFW_FLOGDT("{}", "CFDPHandler::handleRequest\n"); + FSFW_LOGDT("{}", "CFDPHandler::handleRequest\n"); // TODO read out packet from store using storeId diff --git a/src/fsfw/cfdp/pdu/EofPduDeserializer.cpp b/src/fsfw/cfdp/pdu/EofPduDeserializer.cpp index c9d2b5bc..3e77f221 100644 --- a/src/fsfw/cfdp/pdu/EofPduDeserializer.cpp +++ b/src/fsfw/cfdp/pdu/EofPduDeserializer.cpp @@ -50,9 +50,9 @@ ReturnValue_t EofPduDeserializer::parseData() { if (info.getConditionCode() != cfdp::ConditionCode::NO_ERROR) { EntityIdTlv* tlvPtr = info.getFaultLoc(); if (tlvPtr == nullptr) { - FSFW_FLOGW("{}", - "parseData: Ca not deserialize fault location," - " given TLV pointer invalid\n"); + FSFW_LOGW("{}", + "parseData: Ca not deserialize fault location," + " given TLV pointer invalid\n"); return HasReturnvaluesIF::RETURN_FAILED; } result = tlvPtr->deSerialize(&bufPtr, &deserLen, endianness); diff --git a/src/fsfw/cfdp/pdu/VarLenField.cpp b/src/fsfw/cfdp/pdu/VarLenField.cpp index 98391d41..24b04b4a 100644 --- a/src/fsfw/cfdp/pdu/VarLenField.cpp +++ b/src/fsfw/cfdp/pdu/VarLenField.cpp @@ -7,7 +7,7 @@ cfdp::VarLenField::VarLenField(cfdp::WidthInBytes width, size_t value) : VarLenField() { ReturnValue_t result = this->setValue(width, value); if (result != HasReturnvaluesIF::RETURN_OK) { - FSFW_FLOGW("{}", "cfdp::VarLenField: Setting value failed\n"); + FSFW_LOGW("{}", "cfdp::VarLenField: Setting value failed\n"); } } diff --git a/src/fsfw/cfdp/tlv/FilestoreTlvBase.h b/src/fsfw/cfdp/tlv/FilestoreTlvBase.h index 0f4dbf20..528c482b 100644 --- a/src/fsfw/cfdp/tlv/FilestoreTlvBase.h +++ b/src/fsfw/cfdp/tlv/FilestoreTlvBase.h @@ -128,7 +128,7 @@ class FilestoreTlvBase : public TlvIF { } void secondFileNameMissing() const { - FSFW_FLOGWT("{}", "secondFileNameMissing: Second file name required but TLV pointer not set\n"); + FSFW_LOGWT("{}", "secondFileNameMissing: Second file name required but TLV pointer not set\n"); } FilestoreActionCode getActionCode() const { return actionCode; } diff --git a/src/fsfw/datapool/PoolDataSetBase.cpp b/src/fsfw/datapool/PoolDataSetBase.cpp index 93d2ab24..891a95e2 100644 --- a/src/fsfw/datapool/PoolDataSetBase.cpp +++ b/src/fsfw/datapool/PoolDataSetBase.cpp @@ -17,15 +17,15 @@ ReturnValue_t PoolDataSetBase::registerVariable(PoolVariableIF* variable) { return HasReturnvaluesIF::RETURN_FAILED; } if (state != States::STATE_SET_UNINITIALISED) { - FSFW_FLOGW("{}", "registerVariable: Call made in wrong position\n"); + FSFW_LOGW("{}", "registerVariable: Call made in wrong position\n"); return DataSetIF::DATA_SET_UNINITIALISED; } if (variable == nullptr) { - FSFW_FLOGW("{}", "registerVariable: Pool variable is nullptr\n"); + FSFW_LOGW("{}", "registerVariable: Pool variable is nullptr\n"); return DataSetIF::POOL_VAR_NULL; } if (fillCount >= maxFillCount) { - FSFW_FLOGW("{}", "registerVariable: DataSet is full\n"); + FSFW_LOGW("{}", "registerVariable: DataSet is full\n"); return DataSetIF::DATA_SET_FULL; } registeredVariables[fillCount] = variable; @@ -47,7 +47,7 @@ ReturnValue_t PoolDataSetBase::read(MutexIF::TimeoutType timeoutType, uint32_t l state = States::STATE_SET_WAS_READ; unlockDataPool(); } else { - FSFW_FLOGWT("{}", "read: Call made in wrong position. commit call might be missing\n"); + FSFW_LOGWT("{}", "read: Call made in wrong position. commit call might be missing\n"); result = SET_WAS_ALREADY_READ; } diff --git a/src/fsfw/datapool/PoolEntry.cpp b/src/fsfw/datapool/PoolEntry.cpp index 97b23d71..c52f1a0f 100644 --- a/src/fsfw/datapool/PoolEntry.cpp +++ b/src/fsfw/datapool/PoolEntry.cpp @@ -68,7 +68,7 @@ void PoolEntry::print() { } else { validString = "Invalid"; } - FSFW_FLOGI("PoolEntry Info. Validity {}\n", validString); + FSFW_LOGI("PoolEntry Info. Validity {}\n", validString); arrayprinter::print(reinterpret_cast(address), getByteSize()); } diff --git a/src/fsfw/datapool/PoolReadGuard.h b/src/fsfw/datapool/PoolReadGuard.h index 8520bc1a..d9c42fa7 100644 --- a/src/fsfw/datapool/PoolReadGuard.h +++ b/src/fsfw/datapool/PoolReadGuard.h @@ -17,7 +17,7 @@ class PoolReadGuard { if (readObject != nullptr) { readResult = readObject->read(timeoutType, mutexTimeout); if (readResult != HasReturnvaluesIF::RETURN_OK) { - FSFW_FLOGW("{}", "ctor: Read failed\n"); + FSFW_LOGW("{}", "ctor: Read failed\n"); } } } diff --git a/src/fsfw/datapoollocal/HasLocalDataPoolIF.h b/src/fsfw/datapoollocal/HasLocalDataPoolIF.h index 930ccad1..8650c29e 100644 --- a/src/fsfw/datapoollocal/HasLocalDataPoolIF.h +++ b/src/fsfw/datapoollocal/HasLocalDataPoolIF.h @@ -166,7 +166,7 @@ class HasLocalDataPoolIF { * @return */ virtual LocalPoolObjectBase* getPoolObjectHandle(lp_id_t localPoolId) { - FSFW_FLOGW("{}", "HasLocalDataPoolIF::getPoolObjectHandle: Not overriden. Returning nullptr\n"); + FSFW_LOGW("{}", "HasLocalDataPoolIF::getPoolObjectHandle: Not overriden. Returning nullptr\n"); return nullptr; } }; diff --git a/src/fsfw/datapoollocal/LocalDataPoolManager.cpp b/src/fsfw/datapoollocal/LocalDataPoolManager.cpp index 5bff4463..74457310 100644 --- a/src/fsfw/datapoollocal/LocalDataPoolManager.cpp +++ b/src/fsfw/datapoollocal/LocalDataPoolManager.cpp @@ -695,7 +695,7 @@ void LocalDataPoolManager::performPeriodicHkGeneration(HkReceiver& receiver) { ReturnValue_t result = generateHousekeepingPacket(sid, dataSet, true); if (result != HasReturnvaluesIF::RETURN_OK) { /* Configuration error */ - FSFW_FLOGWT("{}", "performHkOperation: HK generation failed"); + FSFW_LOGWT("{}", "performHkOperation: HK generation failed"); } } @@ -852,9 +852,9 @@ void LocalDataPoolManager::printWarningOrError(sif::OutputTypes outputType, } if (outputType == sif::OutputTypes::OUT_WARNING) { - FSFW_FLOGWT("{} | Object ID {} | {}\n", functionName, objectId, errorPrint); + FSFW_LOGWT("{} | Object ID {} | {}\n", functionName, objectId, errorPrint); } else if (outputType == sif::OutputTypes::OUT_ERROR) { - FSFW_FLOGET("{} | Object ID {} | {}\n", functionName, objectId, errorPrint); + FSFW_LOGET("{} | Object ID {} | {}\n", functionName, objectId, errorPrint); } #endif /* #if FSFW_VERBOSE_LEVEL >= 1 */ } diff --git a/src/fsfw/datapoollocal/LocalPoolDataSetBase.cpp b/src/fsfw/datapoollocal/LocalPoolDataSetBase.cpp index ed534896..cd533cd9 100644 --- a/src/fsfw/datapoollocal/LocalPoolDataSetBase.cpp +++ b/src/fsfw/datapoollocal/LocalPoolDataSetBase.cpp @@ -16,7 +16,7 @@ LocalPoolDataSetBase::LocalPoolDataSetBase(HasLocalDataPoolIF *hkOwner, uint32_t : PoolDataSetBase(registeredVariablesArray, maxNumberOfVariables) { if (hkOwner == nullptr) { // Configuration error. - FSFW_FLOGW("{}", "LocalPoolDataSetBase::LocalPoolDataSetBase: Owner invalid\n"); + FSFW_LOGW("{}", "LocalPoolDataSetBase::LocalPoolDataSetBase: Owner invalid\n"); return; } AccessPoolManagerIF *accessor = HasLocalDpIFUserAttorney::getAccessorHandle(hkOwner); @@ -179,7 +179,7 @@ ReturnValue_t LocalPoolDataSetBase::serializeLocalPoolIds(uint8_t **buffer, size auto result = SerializeAdapter::serialize(¤tPoolId, buffer, size, maxSize, streamEndianness); if (result != HasReturnvaluesIF::RETURN_OK) { - FSFW_FLOGW("{}", "serializeLocalPoolIds: Serialization error\n"); + FSFW_LOGW("{}", "serializeLocalPoolIds: Serialization error\n"); return result; } } diff --git a/src/fsfw/datapoollocal/LocalPoolObjectBase.cpp b/src/fsfw/datapoollocal/LocalPoolObjectBase.cpp index 4a920664..5d0a3068 100644 --- a/src/fsfw/datapoollocal/LocalPoolObjectBase.cpp +++ b/src/fsfw/datapoollocal/LocalPoolObjectBase.cpp @@ -11,10 +11,10 @@ LocalPoolObjectBase::LocalPoolObjectBase(lp_id_t poolId, HasLocalDataPoolIF* hkO DataSetIF* dataSet, pool_rwm_t setReadWriteMode) : localPoolId(poolId), readWriteMode(setReadWriteMode) { if (poolId == PoolVariableIF::NO_PARAMETER) { - FSFW_FLOGWT("{}", "ctor: Invalid pool ID, has NO_PARAMETER value\n"); + FSFW_LOGWT("{}", "ctor: Invalid pool ID, has NO_PARAMETER value\n"); } if (hkOwner == nullptr) { - FSFW_FLOGET("{}", "ctor: Supplied pool owner is a invalid\n"); + FSFW_LOGET("{}", "ctor: Supplied pool owner is a invalid\n"); return; } AccessPoolManagerIF* poolManAccessor = HasLocalDpIFUserAttorney::getAccessorHandle(hkOwner); @@ -29,11 +29,11 @@ LocalPoolObjectBase::LocalPoolObjectBase(object_id_t poolOwner, lp_id_t poolId, pool_rwm_t setReadWriteMode) : localPoolId(poolId), readWriteMode(setReadWriteMode) { if (poolId == PoolVariableIF::NO_PARAMETER) { - FSFW_FLOGWT("{}", "ctor: Invalid pool ID, has NO_PARAMETER value\n"); + FSFW_LOGWT("{}", "ctor: Invalid pool ID, has NO_PARAMETER value\n"); } auto* hkOwner = ObjectManager::instance()->get(poolOwner); if (hkOwner == nullptr) { - FSFW_FLOGWT( + FSFW_LOGWT( "ctor: The supplied pool owner {:#08x} did not implement the correct interface " "HasLocalDataPoolIF\n", poolOwner); @@ -94,6 +94,6 @@ void LocalPoolObjectBase::reportReadCommitError(const char* variableType, Return errMsg = "Unknown error code"; } - FSFW_FLOGW("{}: {} call | {} | Owner: {:#08x} | LPID: \n", variablePrintout, type, errMsg, - objectId, lpId); + FSFW_LOGW("{}: {} call | {} | Owner: {:#08x} | LPID: \n", variablePrintout, type, errMsg, + objectId, lpId); } diff --git a/src/fsfw/datapoollocal/LocalPoolVector.tpp b/src/fsfw/datapoollocal/LocalPoolVector.tpp index e26d1fbb..59f3d546 100644 --- a/src/fsfw/datapoollocal/LocalPoolVector.tpp +++ b/src/fsfw/datapoollocal/LocalPoolVector.tpp @@ -98,7 +98,7 @@ inline T& LocalPoolVector::operator [](size_t i) { } // If this happens, I have to set some value. I consider this // a configuration error, but I wont exit here. - FSFW_FLOGWT("{}", "operator[]: Invalid index. Setting or returning last value\n"); + FSFW_LOGWT("{}", "operator[]: Invalid index. Setting or returning last value\n"); return value[vectorSize - 1]; } @@ -109,7 +109,7 @@ inline const T& LocalPoolVector::operator [](size_t i) const { } // If this happens, I have to set some value. I consider this // a configuration error, but I wont exit here. - FSFW_FLOGWT("{}", "operator[]: Invalid index. Setting or returning last value\n"); + FSFW_LOGWT("{}", "operator[]: Invalid index. Setting or returning last value\n"); return value[vectorSize - 1]; } diff --git a/src/fsfw/devicehandlers/DeviceHandlerBase.cpp b/src/fsfw/devicehandlers/DeviceHandlerBase.cpp index 1ca03a31..e51043d9 100644 --- a/src/fsfw/devicehandlers/DeviceHandlerBase.cpp +++ b/src/fsfw/devicehandlers/DeviceHandlerBase.cpp @@ -156,9 +156,9 @@ ReturnValue_t DeviceHandlerBase::initialize() { printWarningOrError(sif::OutputTypes::OUT_ERROR, "initialize", ObjectManagerIF::CHILD_INIT_FAILED, "Raw receiver object ID set but no valid object found."); - FSFW_FLOGE("{}", - "Make sure the raw receiver object is set up properly " - "and implements AcceptsDeviceResponsesIF"); + FSFW_LOGE("{}", + "Make sure the raw receiver object is set up properly " + "and implements AcceptsDeviceResponsesIF"); return ObjectManagerIF::CHILD_INIT_FAILED; } defaultRawReceiver = rawReceiver->getDeviceQueue(); @@ -170,9 +170,9 @@ ReturnValue_t DeviceHandlerBase::initialize() { printWarningOrError(sif::OutputTypes::OUT_ERROR, "initialize", ObjectManagerIF::CHILD_INIT_FAILED, "Power switcher set but no valid object found."); - FSFW_FLOGE("{}", - "Make sure the power switcher object is set up " - "properly and implements PowerSwitchIF\n"); + FSFW_LOGE("{}", + "Make sure the power switcher object is set up " + "properly and implements PowerSwitchIF\n"); return ObjectManagerIF::CHILD_INIT_FAILED; } } @@ -755,9 +755,9 @@ void DeviceHandlerBase::parseReply(const uint8_t* receivedData, size_t receivedD printWarningOrError(sif::OutputTypes::OUT_ERROR, "parseReply", ObjectManagerIF::CHILD_INIT_FAILED, "Power switcher set but no valid object found."); - FSFW_FLOGW("{}", - "DeviceHandlerBase::parseReply: foundLen is 0! " - "Packet parsing will be stuck\n"); + FSFW_LOGW("{}", + "DeviceHandlerBase::parseReply: foundLen is 0! " + "Packet parsing will be stuck\n"); } break; } @@ -1462,11 +1462,11 @@ void DeviceHandlerBase::printWarningOrError(sif::OutputTypes errorType, const ch } if (errorType == sif::OutputTypes::OUT_WARNING) { - FSFW_FLOGWT("{} | Object ID {:#08x} | {}", functionName, SystemObject::getObjectId(), - errorPrint); + FSFW_LOGWT("{} | Object ID {:#08x} | {}", functionName, SystemObject::getObjectId(), + errorPrint); } else if (errorType == sif::OutputTypes::OUT_ERROR) { - FSFW_FLOGET("{} | Object ID {:#08x} | {}", functionName, SystemObject::getObjectId(), - errorPrint); + FSFW_LOGET("{} | Object ID {:#08x} | {}", functionName, SystemObject::getObjectId(), + errorPrint); } } diff --git a/src/fsfw/devicehandlers/DeviceHandlerFailureIsolation.cpp b/src/fsfw/devicehandlers/DeviceHandlerFailureIsolation.cpp index f5285f80..c875f62b 100644 --- a/src/fsfw/devicehandlers/DeviceHandlerFailureIsolation.cpp +++ b/src/fsfw/devicehandlers/DeviceHandlerFailureIsolation.cpp @@ -163,7 +163,7 @@ void DeviceHandlerFailureIsolation::clearFaultCounters() { ReturnValue_t DeviceHandlerFailureIsolation::initialize() { ReturnValue_t result = FailureIsolationBase::initialize(); if (result != HasReturnvaluesIF::RETURN_OK) { - FSFW_FLOGE("{}", "initialize: Could not initialize FailureIsolationBase\n"); + FSFW_LOGE("{}", "initialize: Could not initialize FailureIsolationBase\n"); return result; } auto* power = ObjectManager::instance()->get(powerConfirmationId); diff --git a/src/fsfw/events/EventManagerIF.h b/src/fsfw/events/EventManagerIF.h index 5e2f3b54..2ab9af41 100644 --- a/src/fsfw/events/EventManagerIF.h +++ b/src/fsfw/events/EventManagerIF.h @@ -41,7 +41,7 @@ class EventManagerIF { if (eventmanagerQueue == MessageQueueIF::NO_QUEUE) { auto* eventmanager = ObjectManager::instance()->get(objects::EVENT_MANAGER); if (eventmanager == nullptr) { - FSFW_FLOGW("{}", "EventManagerIF::triggerEvent: EventManager invalid or not found\n"); + FSFW_LOGW("{}", "EventManagerIF::triggerEvent: EventManager invalid or not found\n"); return; } eventmanagerQueue = eventmanager->getEventReportQueue(); diff --git a/src/fsfw/fdir/FailureIsolationBase.cpp b/src/fsfw/fdir/FailureIsolationBase.cpp index b1f731d1..39fbe022 100644 --- a/src/fsfw/fdir/FailureIsolationBase.cpp +++ b/src/fsfw/fdir/FailureIsolationBase.cpp @@ -20,7 +20,7 @@ FailureIsolationBase::~FailureIsolationBase() { ReturnValue_t FailureIsolationBase::initialize() { auto* manager = ObjectManager::instance()->get(objects::EVENT_MANAGER); if (manager == nullptr) { - FSFW_FLOGE("{}", "initialize: Event Manager has not been initialized\n"); + FSFW_LOGE("{}", "initialize: Event Manager has not been initialized\n"); return RETURN_FAILED; } ReturnValue_t result = manager->registerListener(eventQueue->getId()); @@ -34,7 +34,7 @@ ReturnValue_t FailureIsolationBase::initialize() { } owner = ObjectManager::instance()->get(ownerId); if (owner == nullptr) { - FSFW_FLOGE( + FSFW_LOGE( "FailureIsolationBase::intialize: Owner object {:#08x} invalid. " "Does it implement HasHealthIF?\n", ownerId); @@ -44,9 +44,8 @@ ReturnValue_t FailureIsolationBase::initialize() { if (faultTreeParent != objects::NO_OBJECT) { auto* parentIF = ObjectManager::instance()->get(faultTreeParent); if (parentIF == nullptr) { - FSFW_FLOGW( - "intialize: Parent object {:#08x} invalid. Does it implement ConfirmsFailuresIF?\n", - faultTreeParent); + FSFW_LOGW("intialize: Parent object {:#08x} invalid. Does it implement ConfirmsFailuresIF?\n", + faultTreeParent); return ObjectManagerIF::CHILD_INIT_FAILED; } eventQueue->setDefaultDestination(parentIF->getEventReceptionQueue()); diff --git a/src/fsfw/globalfunctions/arrayprinter.cpp b/src/fsfw/globalfunctions/arrayprinter.cpp index c434bc55..c8de8610 100644 --- a/src/fsfw/globalfunctions/arrayprinter.cpp +++ b/src/fsfw/globalfunctions/arrayprinter.cpp @@ -8,11 +8,11 @@ void arrayprinter::print(const uint8_t *data, size_t size, OutputType type, bool printInfo, size_t maxCharPerLine) { if (size == 0) { - FSFW_FLOGI("{}", "Size is zero, nothing to print\n"); + FSFW_LOGI("{}", "Size is zero, nothing to print\n"); return; } - FSFW_FLOGI("Printing data with size {}:\n", size); + FSFW_LOGI("Printing data with size {}:\n", size); if (type == OutputType::HEX) { arrayprinter::printHex(data, size, maxCharPerLine); } else if (type == OutputType::DEC) { diff --git a/src/fsfw/health/HealthHelper.cpp b/src/fsfw/health/HealthHelper.cpp index 22ca76ce..954a1e19 100644 --- a/src/fsfw/health/HealthHelper.cpp +++ b/src/fsfw/health/HealthHelper.cpp @@ -35,12 +35,12 @@ ReturnValue_t HealthHelper::initialize() { eventSender = ObjectManager::instance()->get(objectId); if (healthTable == nullptr) { - FSFW_FLOGE("{}", "initialize: Health table object needs to be created in factory\n"); + FSFW_LOGE("{}", "initialize: Health table object needs to be created in factory\n"); return ObjectManagerIF::CHILD_INIT_FAILED; } if (eventSender == nullptr) { - FSFW_FLOGE("{}", "initialize: Owner has to implement ReportingProxyIF\n"); + FSFW_LOGE("{}", "initialize: Owner has to implement ReportingProxyIF\n"); return ObjectManagerIF::CHILD_INIT_FAILED; } @@ -69,7 +69,7 @@ void HealthHelper::informParent(HasHealthIF::HealthState health, HealthMessage::setHealthMessage(&information, HealthMessage::HEALTH_INFO, health, oldHealth); if (MessageQueueSenderIF::sendMessage(parentQueue, &information, owner->getCommandQueue()) != HasReturnvaluesIF::RETURN_OK) { - FSFW_FLOGWT("informParent: Object ID {:#08x} | Sending health reply failed\n", objectId); + FSFW_LOGWT("informParent: Object ID {:#08x} | Sending health reply failed\n", objectId); } } @@ -86,7 +86,7 @@ void HealthHelper::handleSetHealthCommand(CommandMessage* command) { } if (MessageQueueSenderIF::sendMessage(command->getSender(), &reply, owner->getCommandQueue()) != HasReturnvaluesIF::RETURN_OK) { - FSFW_FLOGWT("handleSetHealthCommand: Object ID {:#08x} | Sending health reply failed\n", - objectId); + FSFW_LOGWT("handleSetHealthCommand: Object ID {:#08x} | Sending health reply failed\n", + objectId); } } diff --git a/src/fsfw/health/HealthTable.cpp b/src/fsfw/health/HealthTable.cpp index 850e647b..e9358bd7 100644 --- a/src/fsfw/health/HealthTable.cpp +++ b/src/fsfw/health/HealthTable.cpp @@ -69,7 +69,7 @@ void HealthTable::printAll(uint8_t* pointer, size_t maxSize) { ReturnValue_t result = SerializeAdapter::serialize(&count, &pointer, &size, maxSize, SerializeIF::Endianness::BIG); if (result != HasReturnvaluesIF::RETURN_OK) { - FSFW_FLOGW("{}", "printAll: Serialization of health table failed\n"); + FSFW_LOGW("{}", "printAll: Serialization of health table failed\n"); return; } for (const auto& health : healthMap) { diff --git a/src/fsfw/ipc/MessageQueueMessage.cpp b/src/fsfw/ipc/MessageQueueMessage.cpp index 4b3477fc..bbaddda1 100644 --- a/src/fsfw/ipc/MessageQueueMessage.cpp +++ b/src/fsfw/ipc/MessageQueueMessage.cpp @@ -15,7 +15,7 @@ MessageQueueMessage::MessageQueueMessage(uint8_t* data, size_t size) memcpy(this->getData(), data, size); this->messageSize = this->HEADER_SIZE + size; } else { - FSFW_FLOGW("{}", "ctor: Passed size larger than maximum allowed size! Setting content to 0\n"); + FSFW_LOGW("{}", "ctor: Passed size larger than maximum allowed size! Setting content to 0\n"); memset(this->internalBuffer, 0, sizeof(this->internalBuffer)); this->messageSize = this->HEADER_SIZE; } diff --git a/src/fsfw/memory/MemoryHelper.cpp b/src/fsfw/memory/MemoryHelper.cpp index 0a3bf779..34cd3017 100644 --- a/src/fsfw/memory/MemoryHelper.cpp +++ b/src/fsfw/memory/MemoryHelper.cpp @@ -17,7 +17,7 @@ ReturnValue_t MemoryHelper::handleMemoryCommand(CommandMessage* message) { lastSender = message->getSender(); lastCommand = message->getCommand(); if (busy) { - FSFW_FLOGW("{}", "MemoryHelper: Busy\n"); + FSFW_LOGW("{}", "MemoryHelper: Busy\n"); } switch (lastCommand) { case MemoryMessage::CMD_MEMORY_DUMP: diff --git a/src/fsfw/monitoring/MonitoringMessageContent.h b/src/fsfw/monitoring/MonitoringMessageContent.h index 9096fdfd..ebb47398 100644 --- a/src/fsfw/monitoring/MonitoringMessageContent.h +++ b/src/fsfw/monitoring/MonitoringMessageContent.h @@ -81,7 +81,7 @@ class MonitoringReportContent : public SerialLinkedListAdapter { if (timeStamper == nullptr) { timeStamper = ObjectManager::instance()->get(timeStamperId); if (timeStamper == nullptr) { - FSFW_FLOGET("{}", "checkAndSetStamper: Stamper not found\n"); + FSFW_LOGET("{}", "checkAndSetStamper: Stamper not found\n"); return false; } } diff --git a/src/fsfw/objectmanager/ObjectManager.cpp b/src/fsfw/objectmanager/ObjectManager.cpp index 83d19349..5d3267be 100644 --- a/src/fsfw/objectmanager/ObjectManager.cpp +++ b/src/fsfw/objectmanager/ObjectManager.cpp @@ -38,8 +38,8 @@ ReturnValue_t ObjectManager::insert(object_id_t id, SystemObjectIF* object) { #endif return this->RETURN_OK; } else { - FSFW_FLOGET("ObjectManager::insert: Object ID {:#08x} is already in use\nTerminating program\n", - static_cast(id)); + FSFW_LOGET("ObjectManager::insert: Object ID {:#08x} is already in use\nTerminating program\n", + static_cast(id)); // This is very severe and difficult to handle in other places. std::exit(INSERTION_FAILED); } @@ -54,7 +54,7 @@ ReturnValue_t ObjectManager::remove(object_id_t id) { #endif return RETURN_OK; } else { - FSFW_FLOGW("removeObject: Requested object {:#08x} not found\n", id); + FSFW_LOGW("removeObject: Requested object {:#08x} not found\n", id); return NOT_FOUND; } } @@ -78,27 +78,27 @@ void ObjectManager::initialize() { result = it.second->initialize(); if (result != RETURN_OK) { object_id_t var = it.first; - FSFW_FLOGWT("initialize: Object {:#08x} failed to initialize with code {:#04x}\n", var, - result); + FSFW_LOGWT("initialize: Object {:#08x} failed to initialize with code {:#04x}\n", var, + result); errorCount++; } } if (errorCount > 0) { - FSFW_FLOGWT("{}", "initialize: Counted failed initializations\n"); + FSFW_LOGWT("{}", "initialize: Counted failed initializations\n"); } // Init was successful. Now check successful interconnections. errorCount = 0; for (auto const& it : objectList) { result = it.second->checkObjectConnections(); if (result != RETURN_OK) { - FSFW_FLOGE("initialize: Object {:#08x} connection check failed with code {:#04x}\n", it.first, - result); + FSFW_LOGE("initialize: Object {:#08x} connection check failed with code {:#04x}\n", it.first, + result); errorCount++; } } if (errorCount > 0) { - FSFW_FLOGE("{}", "ObjectManager::ObjectManager: Counted {} failed connection checks\n", - errorCount); + FSFW_LOGE("{}", "ObjectManager::ObjectManager: Counted {} failed connection checks\n", + errorCount); } } diff --git a/src/fsfw/osal/common/TcpTmTcServer.cpp b/src/fsfw/osal/common/TcpTmTcServer.cpp index b45013fd..ab32d73f 100644 --- a/src/fsfw/osal/common/TcpTmTcServer.cpp +++ b/src/fsfw/osal/common/TcpTmTcServer.cpp @@ -210,7 +210,7 @@ ReturnValue_t TcpTmTcServer::handleTcReception(uint8_t* spacePacket, size_t pack store_address_t storeId; ReturnValue_t result = tcStore->addData(&storeId, spacePacket, packetSize); if (result != HasReturnvaluesIF::RETURN_OK) { - FSFW_FLOGWT("handleTcReception: Data storage with packet size {} failed\n", packetSize); + FSFW_LOGWT("handleTcReception: Data storage with packet size {} failed\n", packetSize); return result; } diff --git a/src/fsfw/osal/common/tcpipCommon.cpp b/src/fsfw/osal/common/tcpipCommon.cpp index dbc0792c..5ac9b7d4 100644 --- a/src/fsfw/osal/common/tcpipCommon.cpp +++ b/src/fsfw/osal/common/tcpipCommon.cpp @@ -61,9 +61,9 @@ void tcpip::printAddress(struct sockaddr *addr) { } } if (stringPtr == nullptr) { - FSFW_FLOGDT("Could not convert IP address to text representation, error code {} | {}", errno, - strerror(errno)); + FSFW_LOGDT("Could not convert IP address to text representation, error code {} | {}", errno, + strerror(errno)); } else { - FSFW_FLOGDT("IP Address Sender {}\n", ipAddress); + FSFW_LOGDT("IP Address Sender {}\n", ipAddress); } } diff --git a/src/fsfw/osal/host/FixedTimeslotTask.cpp b/src/fsfw/osal/host/FixedTimeslotTask.cpp index 78459439..76b00368 100644 --- a/src/fsfw/osal/host/FixedTimeslotTask.cpp +++ b/src/fsfw/osal/host/FixedTimeslotTask.cpp @@ -116,7 +116,7 @@ ReturnValue_t FixedTimeslotTask::addSlot(object_id_t componentId, uint32_t slotT return HasReturnvaluesIF::RETURN_OK; } - FSFW_FLOGE("addSlot: Component {:#08x} not found, not adding it to PST\n", componentId); + FSFW_LOGE("addSlot: Component {:#08x} not found, not adding it to PST\n", componentId); return HasReturnvaluesIF::RETURN_FAILED; } diff --git a/src/fsfw/osal/linux/tcpipHelpers.cpp b/src/fsfw/osal/linux/tcpipHelpers.cpp index 24a70ce8..aee7bd79 100644 --- a/src/fsfw/osal/linux/tcpipHelpers.cpp +++ b/src/fsfw/osal/linux/tcpipHelpers.cpp @@ -96,7 +96,7 @@ void tcpip::handleError(Protocol protocol, ErrorSources errorSrc, dur_millis_t s } #if FSFW_CPP_OSTREAM_ENABLED == 1 - FSFW_FLOGWT("tcpip::handleError: {} | {} | {}\n", protocolString, errorSrcString, infoString); + FSFW_LOGWT("tcpip::handleError: {} | {} | {}\n", protocolString, errorSrcString, infoString); #else sif::printWarning("tcpip::handleError: %s | %s | %s\n", protocolString.c_str(), errorSrcString.c_str(), infoString.c_str()); diff --git a/src/fsfw/parameters/ParameterHelper.cpp b/src/fsfw/parameters/ParameterHelper.cpp index 6543d78e..e5c0357f 100644 --- a/src/fsfw/parameters/ParameterHelper.cpp +++ b/src/fsfw/parameters/ParameterHelper.cpp @@ -44,9 +44,9 @@ ReturnValue_t ParameterHelper::handleParameterMessage(CommandMessage* message) { ConstStorageAccessor accessor(storeId); result = storage->getData(storeId, accessor); if (result != HasReturnvaluesIF::RETURN_OK) { - FSFW_FLOGE("{}", - "ParameterHelper::handleParameterMessage: Getting store data failed for " - "load command\n"); + FSFW_LOGE("{}", + "ParameterHelper::handleParameterMessage: Getting store data failed for " + "load command\n"); break; } diff --git a/src/fsfw/parameters/ParameterWrapper.cpp b/src/fsfw/parameters/ParameterWrapper.cpp index 04da8df6..111facf2 100644 --- a/src/fsfw/parameters/ParameterWrapper.cpp +++ b/src/fsfw/parameters/ParameterWrapper.cpp @@ -209,23 +209,23 @@ ReturnValue_t ParameterWrapper::set(const uint8_t *stream, size_t streamSize, ReturnValue_t ParameterWrapper::copyFrom(const ParameterWrapper *from, uint16_t startWritingAtIndex) { if (data == nullptr) { - FSFW_FLOGWT("{}", "copyFrom: Called on read-only variable\n"); + FSFW_LOGWT("{}", "copyFrom: Called on read-only variable\n"); return READONLY; } if (from->readonlyData == nullptr) { - FSFW_FLOGWT("{}", "copyFrom: Source not set\n"); + FSFW_LOGWT("{}", "copyFrom: Source not set\n"); return SOURCE_NOT_SET; } if (type != from->type) { - FSFW_FLOGW("{}", "copyFrom: Datatype missmatch\n"); + FSFW_LOGW("{}", "copyFrom: Datatype missmatch\n"); return DATATYPE_MISSMATCH; } // The smallest allowed value for rows and columns is one. if (rows == 0 or columns == 0) { - FSFW_FLOGW("{}", "ParameterWrapper::copyFrom: Columns or rows zero\n"); + FSFW_LOGW("{}", "ParameterWrapper::copyFrom: Columns or rows zero\n"); return COLUMN_OR_ROWS_ZERO; } diff --git a/src/fsfw/pus/Service20ParameterManagement.cpp b/src/fsfw/pus/Service20ParameterManagement.cpp index 3974a10d..d173d9b9 100644 --- a/src/fsfw/pus/Service20ParameterManagement.cpp +++ b/src/fsfw/pus/Service20ParameterManagement.cpp @@ -22,7 +22,7 @@ ReturnValue_t Service20ParameterManagement::isValidSubservice(uint8_t subservice case Subservice::PARAMETER_DUMP: return HasReturnvaluesIF::RETURN_OK; default: - FSFW_FLOGE("Invalid Subservice {} for Service 20\n", subservice); + FSFW_LOGE("Invalid Subservice {} for Service 20\n", subservice); return AcceptsTelecommandsIF::INVALID_SUBSERVICE; } } @@ -55,7 +55,7 @@ ReturnValue_t Service20ParameterManagement::checkInterfaceAndAcquireMessageQueue // check ReceivesParameterMessagesIF property of target auto* possibleTarget = ObjectManager::instance()->get(*objectId); if (possibleTarget == nullptr) { - FSFW_FLOGE( + FSFW_LOGE( "checkInterfaceAndAcquire: Can't retrieve message queue | Object ID {:#08x}\n" "Does it implement ReceivesParameterMessagesIF?\n", *objectId); diff --git a/src/fsfw/pus/Service2DeviceAccess.cpp b/src/fsfw/pus/Service2DeviceAccess.cpp index bea926b8..b38bf75b 100644 --- a/src/fsfw/pus/Service2DeviceAccess.cpp +++ b/src/fsfw/pus/Service2DeviceAccess.cpp @@ -25,7 +25,7 @@ ReturnValue_t Service2DeviceAccess::isValidSubservice(uint8_t subservice) { case Subservice::COMMAND_TOGGLE_WIRETAPPING: return HasReturnvaluesIF::RETURN_OK; default: - FSFW_FLOGW("Invalid Subservice {}\n", subservice); + FSFW_LOGW("Invalid Subservice {}\n", subservice); return AcceptsTelecommandsIF::INVALID_SUBSERVICE; } } @@ -116,8 +116,8 @@ void Service2DeviceAccess::handleUnrequestedReply(CommandMessage* reply) { sendWiretappingTm(reply, static_cast(Subservice::REPLY_RAW)); break; default: - FSFW_FLOGET("handleUnrequestedReply: Unknown message with command ID {}\n", - reply->getCommand()); + FSFW_LOGET("handleUnrequestedReply: Unknown message with command ID {}\n", + reply->getCommand()); break; } // Must be reached by all cases to clear message diff --git a/src/fsfw/pus/Service3Housekeeping.cpp b/src/fsfw/pus/Service3Housekeeping.cpp index 66cea102..4ba7ed04 100644 --- a/src/fsfw/pus/Service3Housekeeping.cpp +++ b/src/fsfw/pus/Service3Housekeeping.cpp @@ -212,7 +212,7 @@ ReturnValue_t Service3Housekeeping::handleReply(const CommandMessage* reply, } default: - FSFW_FLOGW("handleReply: Invalid reply with reply command {}\n", command); + FSFW_LOGW("handleReply: Invalid reply with reply command {}\n", command); return CommandingServiceBase::INVALID_REPLY; } return HasReturnvaluesIF::RETURN_OK; diff --git a/src/fsfw/serialize/SerialBufferAdapter.cpp b/src/fsfw/serialize/SerialBufferAdapter.cpp index f3068dad..86c0898a 100644 --- a/src/fsfw/serialize/SerialBufferAdapter.cpp +++ b/src/fsfw/serialize/SerialBufferAdapter.cpp @@ -95,7 +95,7 @@ ReturnValue_t SerialBufferAdapter::deSerialize(const uint8_t** buffer, template uint8_t* SerialBufferAdapter::getBuffer() { if (buffer == nullptr) { - FSFW_FLOGW("{}", "getBuffer: Wrong access function for stored type. Use getConstBuffer\n"); + FSFW_LOGW("{}", "getBuffer: Wrong access function for stored type. Use getConstBuffer\n"); return nullptr; } return buffer; @@ -104,7 +104,7 @@ uint8_t* SerialBufferAdapter::getBuffer() { template const uint8_t* SerialBufferAdapter::getConstBuffer() const { if (constBuffer == nullptr) { - FSFW_FLOGE("{}", "getConstBuffer: Buffers are unitialized\n"); + FSFW_LOGE("{}", "getConstBuffer: Buffers are unitialized\n"); return nullptr; } return constBuffer; diff --git a/src/fsfw/serviceinterface/fmtWrapper.h b/src/fsfw/serviceinterface/fmtWrapper.h index d378f98c..d06d7d04 100644 --- a/src/fsfw/serviceinterface/fmtWrapper.h +++ b/src/fsfw/serviceinterface/fmtWrapper.h @@ -213,30 +213,13 @@ void error_st(const char* file, unsigned int line, fmt::format_string fmt, // The macros postfixed with T are the log variant with timing information #define FSFW_LOGI(...) sif::info(__VA_ARGS__) -#define FSFW_FLOGI(format, ...) sif::info(FMT_STRING(format), __VA_ARGS__) - #define FSFW_LOGIT(...) sif::info_t(__VA_ARGS__) -#define FSFW_FLOGIT(format, ...) sif::info_t(FMT_STRING(format), __VA_ARGS__) #define FSFW_LOGD(...) sif::debug(__FILENAME__, __LINE__, __VA_ARGS__) -#define FSFW_FLOGD(format, ...) sif::debug(__FILENAME__, __LINE__, FMT_STRING(format), __VA_ARGS__) - #define FSFW_LOGDT(...) sif::debug_t(__FILENAME__, __LINE__, __VA_ARGS__) -#define FSFW_FLOGDT(format, ...) \ - sif::debug_t(__FILENAME__, __LINE__, FMT_STRING(format), __VA_ARGS__) #define FSFW_LOGW(...) sif::warning_s(__FILENAME__, __LINE__, __VA_ARGS__) -#define FSFW_FLOGW(format, ...) \ - sif::warning_s(__FILENAME__, __LINE__, FMT_STRING(format), __VA_ARGS__) - #define FSFW_LOGWT(...) sif::warning_st(__FILENAME__, __LINE__, __VA_ARGS__) -#define FSFW_FLOGWT(format, ...) \ - sif::warning_st(__FILENAME__, __LINE__, FMT_STRING(format), __VA_ARGS__) #define FSFW_LOGE(...) sif::error_s(__FILENAME__, __LINE__, __VA_ARGS__) -#define FSFW_FLOGE(format, ...) \ - sif::error_s(__FILENAME__, __LINE__, FMT_STRING(format), __VA_ARGS__) - #define FSFW_LOGET(...) sif::error_st(__FILENAME__, __LINE__, __VA_ARGS__) -#define FSFW_FLOGET(format, ...) \ - sif::error_st(__FILENAME__, __LINE__, FMT_STRING(format), __VA_ARGS__) diff --git a/src/fsfw/storagemanager/ConstStorageAccessor.cpp b/src/fsfw/storagemanager/ConstStorageAccessor.cpp index c050f7cc..6cf99b78 100644 --- a/src/fsfw/storagemanager/ConstStorageAccessor.cpp +++ b/src/fsfw/storagemanager/ConstStorageAccessor.cpp @@ -46,14 +46,14 @@ const uint8_t* ConstStorageAccessor::data() const { return constDataPointer; } size_t ConstStorageAccessor::size() const { if (internalState == AccessState::UNINIT) { - FSFW_FLOGW("{}", "size: Not initialized\n"); + FSFW_LOGW("{}", "size: Not initialized\n"); } return size_; } ReturnValue_t ConstStorageAccessor::getDataCopy(uint8_t* pointer, size_t maxSize) { if (internalState == AccessState::UNINIT) { - FSFW_FLOGW("{}", "getDataCopy: Not initialized\n"); + FSFW_LOGW("{}", "getDataCopy: Not initialized\n"); return HasReturnvaluesIF::RETURN_FAILED; } if (size_ > maxSize) { diff --git a/src/fsfw/storagemanager/LocalPool.cpp b/src/fsfw/storagemanager/LocalPool.cpp index 00be83a6..44e8e818 100644 --- a/src/fsfw/storagemanager/LocalPool.cpp +++ b/src/fsfw/storagemanager/LocalPool.cpp @@ -12,7 +12,7 @@ LocalPool::LocalPool(object_id_t setObjectId, const LocalPoolConfig& poolConfig, NUMBER_OF_SUBPOOLS(poolConfig.size()), spillsToHigherPools(spillsToHigherPools) { if (NUMBER_OF_SUBPOOLS == 0) { - FSFW_FLOGW("{}", "ctor: Passed pool configuration is invalid, 0 subpools\n"); + FSFW_LOGW("{}", "ctor: Passed pool configuration is invalid, 0 subpools\n"); } max_subpools_t index = 0; for (const auto& currentPoolConfig : poolConfig) { @@ -125,8 +125,8 @@ ReturnValue_t LocalPool::deleteData(store_address_t storeId) { sizeLists[storeId.poolIndex][storeId.packetIndex] = STORAGE_FREE; } else { // pool_index or packet_index is too large - FSFW_FLOGWT("Object ID {} | deleteData: Illegal store ID, no deletion\n", - SystemObject::getObjectId()); + FSFW_LOGWT("Object ID {} | deleteData: Illegal store ID, no deletion\n", + SystemObject::getObjectId()); status = ILLEGAL_STORAGE_ID; } return status; @@ -175,7 +175,7 @@ ReturnValue_t LocalPool::initialize() { // Check if any pool size is large than the maximum allowed. for (uint8_t count = 0; count < NUMBER_OF_SUBPOOLS; count++) { if (elementSizes[count] >= STORAGE_FREE) { - FSFW_FLOGW( + FSFW_LOGW( "LocalPool::initialize: Pool is too large- " "Max. allowed size is: {}\n", STORAGE_FREE - 1); @@ -199,7 +199,7 @@ ReturnValue_t LocalPool::reserveSpace(const size_t size, store_address_t* storeI bool ignoreFault) { ReturnValue_t status = getSubPoolIndex(size, &storeId->poolIndex); if (status != RETURN_OK) { - FSFW_FLOGW("ID {:#08x} | reserveSpace: Packet too large\n", SystemObject::getObjectId()); + FSFW_LOGW("ID {:#08x} | reserveSpace: Packet too large\n", SystemObject::getObjectId()); return status; } status = findEmpty(storeId->poolIndex, &storeId->packetIndex); diff --git a/src/fsfw/storagemanager/StorageAccessor.cpp b/src/fsfw/storagemanager/StorageAccessor.cpp index dbfe780b..ae141849 100644 --- a/src/fsfw/storagemanager/StorageAccessor.cpp +++ b/src/fsfw/storagemanager/StorageAccessor.cpp @@ -23,7 +23,7 @@ StorageAccessor::StorageAccessor(StorageAccessor&& other) ReturnValue_t StorageAccessor::getDataCopy(uint8_t* pointer, size_t maxSize) { if (internalState == AccessState::UNINIT) { - FSFW_FLOGW("{}", "getDataCopy: Not initialized\n"); + FSFW_LOGW("{}", "getDataCopy: Not initialized\n"); return HasReturnvaluesIF::RETURN_FAILED; } if (size_ > maxSize) { diff --git a/src/fsfw/tasks/FixedSlotSequence.cpp b/src/fsfw/tasks/FixedSlotSequence.cpp index 4ba02528..81f40bde 100644 --- a/src/fsfw/tasks/FixedSlotSequence.cpp +++ b/src/fsfw/tasks/FixedSlotSequence.cpp @@ -90,7 +90,7 @@ void FixedSlotSequence::addSlot(object_id_t componentId, uint32_t slotTimeMs, in ReturnValue_t FixedSlotSequence::checkSequence() const { if (slotList.empty()) { - FSFW_FLOGW("{}", "FixedSlotSequence::checkSequence: Slot list is empty\n"); + FSFW_LOGW("{}", "FixedSlotSequence::checkSequence: Slot list is empty\n"); return FixedTimeslotTaskIF::SLOT_LIST_EMPTY; } @@ -98,7 +98,7 @@ ReturnValue_t FixedSlotSequence::checkSequence() const { ReturnValue_t result = customCheckFunction(slotList); if (result != HasReturnvaluesIF::RETURN_OK) { // Continue for now but print error output. - FSFW_FLOGW("FixedSlotSequence::checkSequence: Custom check failed with result {}", result); + FSFW_LOGW("FixedSlotSequence::checkSequence: Custom check failed with result {}", result); } } @@ -108,8 +108,8 @@ ReturnValue_t FixedSlotSequence::checkSequence() const { if (slot.executableObject == nullptr) { errorCount++; } else if (slot.pollingTimeMs < time) { - FSFW_FLOGET("FixedSlotSequence::checkSequence: Time {} is smaller than previous with {}\n", - slot.pollingTimeMs, time); + FSFW_LOGET("FixedSlotSequence::checkSequence: Time {} is smaller than previous with {}\n", + slot.pollingTimeMs, time); errorCount++; } else { // All ok, print slot. @@ -144,7 +144,7 @@ ReturnValue_t FixedSlotSequence::intializeSequenceAfterTaskCreation() const { } } if (count > 0) { - FSFW_FLOGE( + FSFW_LOGE( "FixedSlotSequence::intializeSequenceAfterTaskCreation: Counted {} " "failed initializations\n", count); diff --git a/src/fsfw/tcdistribution/CCSDSDistributor.cpp b/src/fsfw/tcdistribution/CCSDSDistributor.cpp index 8dcb39e9..effa7283 100644 --- a/src/fsfw/tcdistribution/CCSDSDistributor.cpp +++ b/src/fsfw/tcdistribution/CCSDSDistributor.cpp @@ -27,7 +27,7 @@ TcDistributor::TcMqMapIter CCSDSDistributor::selectDestination() { size_t size = 0; ReturnValue_t result = this->tcStore->getData(currentMessage.getStorageId(), &packet, &size); if (result != HasReturnvaluesIF::RETURN_OK) { - FSFW_FLOGWT("{}", "selectDestination: Getting data from store failed"); + FSFW_LOGWT("{}", "selectDestination: Getting data from store failed"); } SpacePacketBase currentPacket(packet); diff --git a/src/fsfw/tcdistribution/CFDPDistributor.cpp b/src/fsfw/tcdistribution/CFDPDistributor.cpp index 475ec199..de810bd7 100644 --- a/src/fsfw/tcdistribution/CFDPDistributor.cpp +++ b/src/fsfw/tcdistribution/CFDPDistributor.cpp @@ -22,8 +22,8 @@ CFDPDistributor::~CFDPDistributor() {} CFDPDistributor::TcMqMapIter CFDPDistributor::selectDestination() { #if FSFW_CFDP_DISTRIBUTOR_DEBUGGING == 1 store_address_t storeId = this->currentMessage.getStorageId(); - FSFW_FLOGI("selectDestination was called with pool index {} and packet index {}\n", - storeId.poolIndex, storeId.packetIndex); + FSFW_LOGI("selectDestination was called with pool index {} and packet index {}\n", + storeId.poolIndex, storeId.packetIndex); #endif TcMqMapIter queueMapIt = this->queueMap.end(); if (this->currentPacket == nullptr) { @@ -33,8 +33,7 @@ CFDPDistributor::TcMqMapIter CFDPDistributor::selectDestination() { if (currentPacket->getWholeData() != nullptr) { tcStatus = checker.checkPacket(currentPacket); if (tcStatus != HasReturnvaluesIF::RETURN_OK) { - FSFW_FLOGWT("selectDestination: Packet format invalid, code {}\n", - static_cast(tcStatus)); + FSFW_LOGWT("selectDestination: Packet format invalid, code {}\n", static_cast(tcStatus)); } queueMapIt = this->queueMap.find(0); } else { @@ -43,7 +42,7 @@ CFDPDistributor::TcMqMapIter CFDPDistributor::selectDestination() { if (queueMapIt == this->queueMap.end()) { tcStatus = DESTINATION_NOT_FOUND; - FSFW_FLOGWT("{}", "handlePacket: Destination not found\n"); + FSFW_LOGWT("{}", "handlePacket: Destination not found\n"); } if (tcStatus != RETURN_OK) { @@ -56,11 +55,11 @@ CFDPDistributor::TcMqMapIter CFDPDistributor::selectDestination() { ReturnValue_t CFDPDistributor::registerHandler(AcceptsTelecommandsIF* handler) { uint16_t handlerId = handler->getIdentifier(); // should be 0, because CFDPHandler does not set a set a service-ID - FSFW_FLOGIT("CFDPDistributor::registerHandler: Handler ID {}\n", static_cast(handlerId)); + FSFW_LOGIT("CFDPDistributor::registerHandler: Handler ID {}\n", static_cast(handlerId)); MessageQueueId_t queue = handler->getRequestQueue(); auto returnPair = queueMap.emplace(handlerId, queue); if (not returnPair.second) { - FSFW_FLOGE("{}", "CFDPDistributor::registerHandler: Service ID already exists in map\n"); + FSFW_LOGE("{}", "CFDPDistributor::registerHandler: Service ID already exists in map\n"); return SERVICE_ID_ALREADY_EXISTS; } return HasReturnvaluesIF::RETURN_OK; @@ -97,7 +96,7 @@ ReturnValue_t CFDPDistributor::initialize() { auto* ccsdsDistributor = ObjectManager::instance()->get(packetSource); if (ccsdsDistributor == nullptr) { - FSFW_FLOGE("{}", "initialize: Packet source invalid. Does it implement CCSDSDistributorIF?\n"); + FSFW_LOGE("{}", "initialize: Packet source invalid. Does it implement CCSDSDistributorIF?\n"); return RETURN_FAILED; } return ccsdsDistributor->registerApplication(this); diff --git a/src/fsfw/tcdistribution/PUSDistributor.cpp b/src/fsfw/tcdistribution/PUSDistributor.cpp index 36ab75a7..bcd31454 100644 --- a/src/fsfw/tcdistribution/PUSDistributor.cpp +++ b/src/fsfw/tcdistribution/PUSDistributor.cpp @@ -44,7 +44,7 @@ PUSDistributor::TcMqMapIter PUSDistributor::selectDestination() { } else if (tcStatus == TcPacketCheckPUS::INCOMPLETE_PACKET) { keyword = "incomplete packet"; } - FSFW_FLOGWT("selectDestination: Packet format invalid, {} error\n", keyword); + FSFW_LOGWT("selectDestination: Packet format invalid, {} error\n", keyword); #endif } uint32_t queue_id = currentPacket->getService(); diff --git a/src/fsfw/tcdistribution/TcDistributor.cpp b/src/fsfw/tcdistribution/TcDistributor.cpp index 42c28370..b9b3a999 100644 --- a/src/fsfw/tcdistribution/TcDistributor.cpp +++ b/src/fsfw/tcdistribution/TcDistributor.cpp @@ -33,9 +33,9 @@ ReturnValue_t TcDistributor::handlePacket() { } void TcDistributor::print() { - FSFW_FLOGI("{}", "Distributor content is:\nID\t| Message Queue ID"); + FSFW_LOGI("{}", "Distributor content is:\nID\t| Message Queue ID"); for (const auto& queueMapIter : queueMap) { - FSFW_FLOGI("{} \t| {:#08x}", queueMapIter.first, queueMapIter.second); + FSFW_LOGI("{} \t| {:#08x}", queueMapIter.first, queueMapIter.second); } } diff --git a/src/fsfw/timemanager/Stopwatch.cpp b/src/fsfw/timemanager/Stopwatch.cpp index f54dc389..983c9713 100644 --- a/src/fsfw/timemanager/Stopwatch.cpp +++ b/src/fsfw/timemanager/Stopwatch.cpp @@ -31,10 +31,10 @@ void Stopwatch::display() { if (displayMode == StopwatchDisplayMode::MILLIS) { auto timeMillis = static_cast(elapsedTime.tv_sec * 1000 + elapsedTime.tv_usec / 1000); - FSFW_FLOGIT("Stopwatch::display: {} ms elapsed\n", timeMillis); + FSFW_LOGIT("Stopwatch::display: {} ms elapsed\n", timeMillis); } else if (displayMode == StopwatchDisplayMode::SECONDS) { - FSFW_FLOGIT("Stopwatch::display: {} seconds elapsed\n", - static_cast(timevalOperations::toDouble(elapsedTime))); + FSFW_LOGIT("Stopwatch::display: {} seconds elapsed\n", + static_cast(timevalOperations::toDouble(elapsedTime))); } } diff --git a/src/fsfw/tmtcpacket/SpacePacketBase.cpp b/src/fsfw/tmtcpacket/SpacePacketBase.cpp index 03ae5427..89158593 100644 --- a/src/fsfw/tmtcpacket/SpacePacketBase.cpp +++ b/src/fsfw/tmtcpacket/SpacePacketBase.cpp @@ -18,7 +18,7 @@ uint8_t SpacePacketBase::getPacketVersionNumber(void) { ReturnValue_t SpacePacketBase::initSpacePacketHeader(bool isTelecommand, bool hasSecondaryHeader, uint16_t apid, uint16_t sequenceCount) { if (data == nullptr) { - FSFW_FLOGWT("{}", "initSpacePacketHeader: Data pointer is invalid\n"); + FSFW_LOGWT("{}", "initSpacePacketHeader: Data pointer is invalid\n"); return HasReturnvaluesIF::RETURN_FAILED; } // reset header to zero: diff --git a/src/fsfw/tmtcpacket/cfdp/CFDPPacket.cpp b/src/fsfw/tmtcpacket/cfdp/CFDPPacket.cpp index 816ffbc5..5f895709 100644 --- a/src/fsfw/tmtcpacket/cfdp/CFDPPacket.cpp +++ b/src/fsfw/tmtcpacket/cfdp/CFDPPacket.cpp @@ -11,6 +11,6 @@ CFDPPacket::CFDPPacket(const uint8_t* setData) : SpacePacketBase(setData) {} CFDPPacket::~CFDPPacket() {} void CFDPPacket::print() { - FSFW_FLOGI("{}", "CFDPPacket::print:\n"); + FSFW_LOGI("{}", "CFDPPacket::print:\n"); arrayprinter::print(getWholeData(), getFullSize()); } diff --git a/src/fsfw/tmtcpacket/pus/tm/TmPacketStoredBase.cpp b/src/fsfw/tmtcpacket/pus/tm/TmPacketStoredBase.cpp index ad07e255..975f3bb6 100644 --- a/src/fsfw/tmtcpacket/pus/tm/TmPacketStoredBase.cpp +++ b/src/fsfw/tmtcpacket/pus/tm/TmPacketStoredBase.cpp @@ -89,13 +89,13 @@ void TmPacketStoredBase::handleStoreFailure(const char *const packetType, Return switch (result) { #if FSFW_CPP_OSTREAM_ENABLED == 1 case (StorageManagerIF::DATA_STORAGE_FULL): { - FSFW_FLOGWT("handleStoreFailure: {} | Store full for packet with size {}\n", packetType, - sizeToReserve); + FSFW_LOGWT("handleStoreFailure: {} | Store full for packet with size {}\n", packetType, + sizeToReserve); break; } case (StorageManagerIF::DATA_TOO_LARGE): { - FSFW_FLOGWT("handleStoreFailure: {} | Data with size {} too large\n", packetType, - sizeToReserve); + FSFW_LOGWT("handleStoreFailure: {} | Data with size {} too large\n", packetType, + sizeToReserve); break; } #else diff --git a/src/fsfw/tmtcservices/CommandingServiceBase.cpp b/src/fsfw/tmtcservices/CommandingServiceBase.cpp index 40a33df9..36e8981d 100644 --- a/src/fsfw/tmtcservices/CommandingServiceBase.cpp +++ b/src/fsfw/tmtcservices/CommandingServiceBase.cpp @@ -95,7 +95,7 @@ void CommandingServiceBase::handleCommandQueue() { } else if (result == MessageQueueIF::EMPTY) { break; } else { - FSFW_FLOGWT( + FSFW_LOGWT( "CommandingServiceBase::handleCommandQueue: Receiving message failed" "with code {}", result); diff --git a/src/fsfw/tmtcservices/PusServiceBase.cpp b/src/fsfw/tmtcservices/PusServiceBase.cpp index a8cf58c9..0786d225 100644 --- a/src/fsfw/tmtcservices/PusServiceBase.cpp +++ b/src/fsfw/tmtcservices/PusServiceBase.cpp @@ -22,7 +22,7 @@ ReturnValue_t PusServiceBase::performOperation(uint8_t opCode) { handleRequestQueue(); ReturnValue_t result = this->performService(); if (result != RETURN_OK) { - FSFW_FLOGWT("performOperation: PUS service {} return with error {}\n", serviceId, result); + FSFW_LOGWT("performOperation: PUS service {} return with error {}\n", serviceId, result); return RETURN_FAILED; } return RETURN_OK; @@ -71,8 +71,8 @@ void PusServiceBase::handleRequestQueue() { // ": no new packet." << std::endl; break; } else { - FSFW_FLOGWT("performOperation: Service {}. Error receiving packed, code {}\n", serviceId, - status); + FSFW_LOGWT("performOperation: Service {}. Error receiving packed, code {}\n", serviceId, + status); } } } @@ -89,7 +89,7 @@ ReturnValue_t PusServiceBase::initialize() { auto* destService = ObjectManager::instance()->get(packetDestination); auto* distributor = ObjectManager::instance()->get(packetSource); if (destService == nullptr or distributor == nullptr) { - FSFW_FLOGWT( + FSFW_LOGWT( "ctor: Service {} | Make sure static packetSource and packetDestination " "are defined correctly\n", serviceId); diff --git a/src/fsfw/tmtcservices/TmTcBridge.cpp b/src/fsfw/tmtcservices/TmTcBridge.cpp index f8c70cff..82ab4fbf 100644 --- a/src/fsfw/tmtcservices/TmTcBridge.cpp +++ b/src/fsfw/tmtcservices/TmTcBridge.cpp @@ -37,7 +37,7 @@ ReturnValue_t TmTcBridge::setMaxNumberOfPacketsStored(uint8_t maxNumberOfPackets this->maxNumberOfPacketsStored = maxNumberOfPacketsStored_; return RETURN_OK; } else { - FSFW_FLOGW( + FSFW_LOGW( "setMaxNumberOfPacketsStored: Passed number of packets {} stored exceeds " "limit {}\nKeeping default value\n", maxNumberOfPacketsStored_, LIMIT_DOWNLINK_PACKETS_STORED); @@ -87,7 +87,7 @@ ReturnValue_t TmTcBridge::handleTm() { ReturnValue_t status = HasReturnvaluesIF::RETURN_OK; ReturnValue_t result = handleTmQueue(); if (result != RETURN_OK) { - FSFW_FLOGET("handleTm: Error handling TM queue with error code {:#04x}\n", result); + FSFW_LOGET("handleTm: Error handling TM queue with error code {:#04x}\n", result); status = result; } diff --git a/src/fsfw/tmtcservices/VerificationReporter.cpp b/src/fsfw/tmtcservices/VerificationReporter.cpp index 8323362a..6b5ae826 100644 --- a/src/fsfw/tmtcservices/VerificationReporter.cpp +++ b/src/fsfw/tmtcservices/VerificationReporter.cpp @@ -26,8 +26,8 @@ void VerificationReporter::sendSuccessReport(uint8_t set_report_id, TcPacketPusB currentPacket->getPacketSequenceControl(), 0, set_step); ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue, &message); if (status != HasReturnvaluesIF::RETURN_OK) { - FSFW_FLOGET("VerificationReporter::sendSuccessReport: Error writing to queue. Code: {}\n", - status); + FSFW_LOGET("VerificationReporter::sendSuccessReport: Error writing to queue. Code: {}\n", + status); } } @@ -41,7 +41,7 @@ void VerificationReporter::sendSuccessReport(uint8_t set_report_id, uint8_t ackF set_step); ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue, &message); if (status != HasReturnvaluesIF::RETURN_OK) { - FSFW_FLOGET( + FSFW_LOGET( "VerificationReporter::sendSuccessReport: Error writing " "to queue. Code: {}\n", status); @@ -62,7 +62,7 @@ void VerificationReporter::sendFailureReport(uint8_t report_id, TcPacketPusBase* currentPacket->getPacketSequenceControl(), error_code, step, parameter1, parameter2); ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue, &message); if (status != HasReturnvaluesIF::RETURN_OK) { - FSFW_FLOGET( + FSFW_LOGET( "VerificationReporter::sendFailureReport: Error writing " "to queue. Code: {}\n", status); diff --git a/tests/src/fsfw_tests/integration/devices/TestDeviceHandler.cpp b/tests/src/fsfw_tests/integration/devices/TestDeviceHandler.cpp index 12f8501b..47ff80a6 100644 --- a/tests/src/fsfw_tests/integration/devices/TestDeviceHandler.cpp +++ b/tests/src/fsfw_tests/integration/devices/TestDeviceHandler.cpp @@ -17,7 +17,7 @@ TestDevice::~TestDevice() {} void TestDevice::performOperationHook() { if (periodicPrintout) { - FSFW_FLOGI("TestDevice {} | performOperationHook: Alive!\n", deviceIdx); + FSFW_LOGI("TestDevice {} | performOperationHook: Alive!\n", deviceIdx); } if (oneShot) { @@ -27,7 +27,7 @@ void TestDevice::performOperationHook() { void TestDevice::doStartUp() { if (fullInfoPrintout) { - FSFW_FLOGI("TestDevice {} | doStartUp: Switching On\n", deviceIdx); + FSFW_LOGI("TestDevice {} | doStartUp: Switching On\n", deviceIdx); } setMode(_MODE_TO_ON); @@ -35,7 +35,7 @@ void TestDevice::doStartUp() { void TestDevice::doShutDown() { if (fullInfoPrintout) { - FSFW_FLOGI("TestDevice {} | doShutDown: Switching Off\n", deviceIdx); + FSFW_LOGI("TestDevice {} | doShutDown: Switching Off\n", deviceIdx); } setMode(_MODE_SHUT_DOWN); @@ -53,7 +53,7 @@ ReturnValue_t TestDevice::buildNormalDeviceCommand(DeviceCommandId_t* id) { ReturnValue_t TestDevice::buildTransitionDeviceCommand(DeviceCommandId_t* id) { if (mode == _MODE_TO_ON) { if (fullInfoPrintout) { - FSFW_FLOGI( + FSFW_LOGI( "TestDevice {} | buildTransitionDeviceCommand: Was called" " from _MODE_TO_ON mode\n", deviceIdx); @@ -61,7 +61,7 @@ ReturnValue_t TestDevice::buildTransitionDeviceCommand(DeviceCommandId_t* id) { } if (mode == _MODE_TO_NORMAL) { if (fullInfoPrintout) { - FSFW_FLOGI( + FSFW_LOGI( "TestDevice {} | buildTransitionDeviceCommand: Was called " "from _MODE_TO_NORMAL mode\n", deviceIdx); @@ -71,7 +71,7 @@ ReturnValue_t TestDevice::buildTransitionDeviceCommand(DeviceCommandId_t* id) { } if (mode == _MODE_SHUT_DOWN) { if (fullInfoPrintout) { - FSFW_FLOGI( + FSFW_LOGI( "TestDevice {} | buildTransitionDeviceCommand: Was called " "from _MODE_SHUT_DOWN mode\n", deviceIdx); @@ -85,7 +85,7 @@ ReturnValue_t TestDevice::buildTransitionDeviceCommand(DeviceCommandId_t* id) { void TestDevice::doTransition(Mode_t modeFrom, Submode_t submodeFrom) { if (mode == _MODE_TO_NORMAL) { if (fullInfoPrintout) { - FSFW_FLOGI( + FSFW_LOGI( "TestDevice {} | doTransition: Custom transition to " "normal mode\n", deviceIdx); diff --git a/tests/src/fsfw_tests/internal/UnittDefinitions.cpp b/tests/src/fsfw_tests/internal/UnittDefinitions.cpp index f2822af3..87b60de9 100644 --- a/tests/src/fsfw_tests/internal/UnittDefinitions.cpp +++ b/tests/src/fsfw_tests/internal/UnittDefinitions.cpp @@ -3,6 +3,6 @@ #include "fsfw/serviceinterface.h" ReturnValue_t unitt::put_error(const std::string& errorId) { - FSFW_FLOGET("Unit Tester error: Failed at test ID {}\n", errorId); + FSFW_LOGET("Unit Tester error: Failed at test ID {}\n", errorId); return HasReturnvaluesIF::RETURN_FAILED; }