diff --git a/datapoollocal/LocalDataPoolManager.h b/datapoollocal/LocalDataPoolManager.h index bcb8f0af..7fa480cb 100644 --- a/datapoollocal/LocalDataPoolManager.h +++ b/datapoollocal/LocalDataPoolManager.h @@ -377,11 +377,11 @@ ReturnValue_t LocalDataPoolManager::fetchPoolEntry(lp_id_t localPoolId, auto poolIter = localPoolMap.find(localPoolId); if (poolIter == localPoolMap.end()) { #if FSFW_CPP_OSTREAM_ENABLED == 1 - sif::warning << "HousekeepingManager::fechPoolEntry: Pool entry " + sif::warning << "HousekeepingManager::fetchPoolEntry: Pool entry " "not found." << std::endl; #else - fsfw::printWarning("HousekeepingManager::fechPoolEntry: Pool entry " - "not found."); + fsfw::printWarning("HousekeepingManager::fetchPoolEntry: Pool entry " + "not found.\n"); #endif return HasLocalDataPoolIF::POOL_ENTRY_NOT_FOUND; } @@ -393,7 +393,7 @@ ReturnValue_t LocalDataPoolManager::fetchPoolEntry(lp_id_t localPoolId, " Pool entry type conflict." << std::endl; #else fsfw::printWarning("HousekeepingManager::fetchPoolEntry:" - " Pool entry type conflict."); + " Pool entry type conflict.\n"); #endif return HasLocalDataPoolIF::POOL_ENTRY_TYPE_CONFLICT; } diff --git a/datapoollocal/LocalPoolObjectBase.cpp b/datapoollocal/LocalPoolObjectBase.cpp index b84569b8..bb7822da 100644 --- a/datapoollocal/LocalPoolObjectBase.cpp +++ b/datapoollocal/LocalPoolObjectBase.cpp @@ -110,13 +110,12 @@ void LocalPoolObjectBase::reportReadCommitError(const char* variableType, #if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << variableType << ": " << type << " call | " << errMsg - << " | Owner: " << std::hex << std::setw(8) - << std::setfill('0') << objectId << " LPID: 0x" << lpId - << std::dec << std::endl; + << " | Owner: 0x" << std::hex << std::setw(8) + << std::setfill('0') << objectId << std::dec << " LPID: " << lpId + << std::endl; #else - fsfw::printWarning("LocalPoolVariable: %s of local pool variable of " - "object 0x%08x and lp ID 0x%08x failed.\n\r", - type, objectId, lpId); + fsfw::printWarning("%s: %s call | %s | Owner: 0x%08x LPID: %lu\n", + variableType, type, errMsg, objectId, lpId); #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ #endif /* FSFW_DISABLE_PRINTOUT == 0 */ } diff --git a/datapoollocal/LocalPoolVector.tpp b/datapoollocal/LocalPoolVector.tpp index 6612a491..94f3916e 100644 --- a/datapoollocal/LocalPoolVector.tpp +++ b/datapoollocal/LocalPoolVector.tpp @@ -98,11 +98,11 @@ 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. #if FSFW_CPP_OSTREAM_ENABLED == 1 - sif::error << "LocalPoolVector: Invalid index. Setting or returning" + sif::warning << "LocalPoolVector: Invalid index. Setting or returning" " last value!" << std::endl; #else - fsfw::printError("LocalPoolVector: Invalid index. Setting or returning" - " last value!\n\r"); + fsfw::printWarning("LocalPoolVector: Invalid index. Setting or returning" + " last value!\n"); #endif return value[vectorSize]; } @@ -115,11 +115,11 @@ 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. #if FSFW_CPP_OSTREAM_ENABLED == 1 - sif::error << "LocalPoolVector: Invalid index. Setting or returning" + sif::warning << "LocalPoolVector: Invalid index. Setting or returning" " last value!" << std::endl; #else - fsfw::printError("LocalPoolVector: Invalid index. Setting or returning" - " last value!\n\r"); + fsfw::printWarning("LocalPoolVector: Invalid index. Setting or returning" + " last value!\n"); #endif return value[vectorSize]; } diff --git a/serviceinterface/ServiceInterfacePrinter.cpp b/serviceinterface/ServiceInterfacePrinter.cpp index 15e738a8..cb3a958d 100644 --- a/serviceinterface/ServiceInterfacePrinter.cpp +++ b/serviceinterface/ServiceInterfacePrinter.cpp @@ -10,7 +10,7 @@ fsfw::PrintLevel printLevel = fsfw::PrintLevel::DEBUG; #if defined(WIN32) && FSFW_COLORED_OUTPUT == 1 bool consoleInitialized = false; #endif /* defined(WIN32) && FSFW_COLORED_OUTPUT == 1 */ - +bool addCrAtEnd = false; #if FSFW_DISABLE_PRINTOUT == 0 uint8_t printBuffer[fsfwconfig::FSFW_PRINT_BUFFER_SIZE]; @@ -80,6 +80,10 @@ void fsfwPrint(fsfw::PrintLevel printType, const char* fmt, va_list arg) { len += vsnprintf(bufferPosition + len, sizeof(printBuffer) - len, fmt, arg); + if(addCrAtEnd) { + len += sprintf(bufferPosition + len, "\r"); + } + printf("%s", printBuffer); } @@ -105,6 +109,10 @@ void fsfw::printDebug(const char *fmt, ...) { va_end(args); } +void fsfw::setToAddCrAtEnd(bool addCrAtEnd_) { + addCrAtEnd = addCrAtEnd_; +} + void fsfw::printError(const char *fmt, ...) { va_list args; va_start(args, fmt); diff --git a/serviceinterface/ServiceInterfacePrinter.h b/serviceinterface/ServiceInterfacePrinter.h index a60b6332..1f82ba98 100644 --- a/serviceinterface/ServiceInterfacePrinter.h +++ b/serviceinterface/ServiceInterfacePrinter.h @@ -16,6 +16,8 @@ enum class PrintLevel { void setPrintLevel(PrintLevel printLevel); PrintLevel getPrintLevel(); +void setToAddCrAtEnd(bool addCrAtEnd_); + /** * These functions can be used like the C stdio printf and forward the * supplied formatted string arguments to a printf function.