some format fixes
This commit is contained in:
parent
f518bc53db
commit
e8a5f1e095
@ -34,7 +34,7 @@ LocalPoolObjectBase::LocalPoolObjectBase(object_id_t poolOwner, lp_id_t poolId,
|
|||||||
auto* hkOwner = ObjectManager::instance()->get<HasLocalDataPoolIF>(poolOwner);
|
auto* hkOwner = ObjectManager::instance()->get<HasLocalDataPoolIF>(poolOwner);
|
||||||
if (hkOwner == nullptr) {
|
if (hkOwner == nullptr) {
|
||||||
FSFW_LOGWT(
|
FSFW_LOGWT(
|
||||||
"ctor: The supplied pool owner {:#08x} did not implement the correct interface "
|
"ctor: The supplied pool owner {:#010x} did not implement the correct interface "
|
||||||
"HasLocalDataPoolIF\n",
|
"HasLocalDataPoolIF\n",
|
||||||
poolOwner);
|
poolOwner);
|
||||||
return;
|
return;
|
||||||
@ -94,6 +94,6 @@ void LocalPoolObjectBase::reportReadCommitError(const char* variableType, Return
|
|||||||
errMsg = "Unknown error code";
|
errMsg = "Unknown error code";
|
||||||
}
|
}
|
||||||
|
|
||||||
FSFW_LOGW("{}: {} call | {} | Owner: {:#08x} | LPID: \n", variablePrintout, type, errMsg,
|
FSFW_LOGW("{}: {} call | {} | Owner: {:#010x} | LPID: \n", variablePrintout, type, errMsg,
|
||||||
objectId, lpId);
|
objectId, lpId);
|
||||||
}
|
}
|
||||||
|
@ -1459,10 +1459,10 @@ void DeviceHandlerBase::printWarningOrError(sif::LogLevel errorType, const char*
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (errorType == sif::LogLevel::WARNING) {
|
if (errorType == sif::LogLevel::WARNING) {
|
||||||
FSFW_LOGWT("{} | Object ID {:#08x} | {}", functionName, SystemObject::getObjectId(),
|
FSFW_LOGWT("{} | Object ID {:#010x} | {}", functionName, SystemObject::getObjectId(),
|
||||||
errorPrint);
|
errorPrint);
|
||||||
} else if (errorType == sif::LogLevel::ERROR) {
|
} else if (errorType == sif::LogLevel::ERROR) {
|
||||||
FSFW_LOGET("{} | Object ID {:#08x} | {}", functionName, SystemObject::getObjectId(),
|
FSFW_LOGET("{} | Object ID {:#010x} | {}", functionName, SystemObject::getObjectId(),
|
||||||
errorPrint);
|
errorPrint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ ReturnValue_t FailureIsolationBase::initialize() {
|
|||||||
owner = ObjectManager::instance()->get<HasHealthIF>(ownerId);
|
owner = ObjectManager::instance()->get<HasHealthIF>(ownerId);
|
||||||
if (owner == nullptr) {
|
if (owner == nullptr) {
|
||||||
FSFW_LOGE(
|
FSFW_LOGE(
|
||||||
"FailureIsolationBase::intialize: Owner object {:#08x} invalid. "
|
"FailureIsolationBase::intialize: Owner object {:#010x} invalid. "
|
||||||
"Does it implement HasHealthIF?\n",
|
"Does it implement HasHealthIF?\n",
|
||||||
ownerId);
|
ownerId);
|
||||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||||
@ -44,7 +44,8 @@ ReturnValue_t FailureIsolationBase::initialize() {
|
|||||||
if (faultTreeParent != objects::NO_OBJECT) {
|
if (faultTreeParent != objects::NO_OBJECT) {
|
||||||
auto* parentIF = ObjectManager::instance()->get<ConfirmsFailuresIF>(faultTreeParent);
|
auto* parentIF = ObjectManager::instance()->get<ConfirmsFailuresIF>(faultTreeParent);
|
||||||
if (parentIF == nullptr) {
|
if (parentIF == nullptr) {
|
||||||
FSFW_LOGW("intialize: Parent object {:#08x} invalid. Does it implement ConfirmsFailuresIF?\n",
|
FSFW_LOGW(
|
||||||
|
"intialize: Parent object {:#010x} invalid. Does it implement ConfirmsFailuresIF?\n",
|
||||||
faultTreeParent);
|
faultTreeParent);
|
||||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ void HealthHelper::informParent(HasHealthIF::HealthState health,
|
|||||||
HealthMessage::setHealthMessage(&information, HealthMessage::HEALTH_INFO, health, oldHealth);
|
HealthMessage::setHealthMessage(&information, HealthMessage::HEALTH_INFO, health, oldHealth);
|
||||||
if (MessageQueueSenderIF::sendMessage(parentQueue, &information, owner->getCommandQueue()) !=
|
if (MessageQueueSenderIF::sendMessage(parentQueue, &information, owner->getCommandQueue()) !=
|
||||||
HasReturnvaluesIF::RETURN_OK) {
|
HasReturnvaluesIF::RETURN_OK) {
|
||||||
FSFW_LOGWT("informParent: Object ID {:#08x} | Sending health reply failed\n", objectId);
|
FSFW_LOGWT("informParent: Object ID {:#010x} | Sending health reply failed\n", objectId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ void HealthHelper::handleSetHealthCommand(CommandMessage* command) {
|
|||||||
}
|
}
|
||||||
if (MessageQueueSenderIF::sendMessage(command->getSender(), &reply, owner->getCommandQueue()) !=
|
if (MessageQueueSenderIF::sendMessage(command->getSender(), &reply, owner->getCommandQueue()) !=
|
||||||
HasReturnvaluesIF::RETURN_OK) {
|
HasReturnvaluesIF::RETURN_OK) {
|
||||||
FSFW_LOGWT("handleSetHealthCommand: Object ID {:#08x} | Sending health reply failed\n",
|
FSFW_LOGWT("handleSetHealthCommand: Object ID {:#010x} | Sending health reply failed\n",
|
||||||
objectId);
|
objectId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ ReturnValue_t ObjectManager::insert(object_id_t id, SystemObjectIF* object) {
|
|||||||
#endif
|
#endif
|
||||||
return ObjectManager::RETURN_OK;
|
return ObjectManager::RETURN_OK;
|
||||||
} else {
|
} else {
|
||||||
FSFW_LOGET("ObjectManager::insert: Object ID {:#08x} is already in use\nTerminating program\n",
|
FSFW_LOGET("ObjectManager::insert: Object ID {:#010x} is already in use\nTerminating program\n",
|
||||||
static_cast<uint32_t>(id));
|
static_cast<uint32_t>(id));
|
||||||
// This is very severe and difficult to handle in other places.
|
// This is very severe and difficult to handle in other places.
|
||||||
std::exit(INSERTION_FAILED);
|
std::exit(INSERTION_FAILED);
|
||||||
@ -54,7 +54,7 @@ ReturnValue_t ObjectManager::remove(object_id_t id) {
|
|||||||
#endif
|
#endif
|
||||||
return RETURN_OK;
|
return RETURN_OK;
|
||||||
} else {
|
} else {
|
||||||
FSFW_LOGW("removeObject: Requested object {:#08x} not found\n", id);
|
FSFW_LOGW("removeObject: Requested object {:#010x} not found\n", id);
|
||||||
return NOT_FOUND;
|
return NOT_FOUND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -78,7 +78,7 @@ void ObjectManager::initialize() {
|
|||||||
result = it.second->initialize();
|
result = it.second->initialize();
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
object_id_t var = it.first;
|
object_id_t var = it.first;
|
||||||
FSFW_LOGWT("initialize: Object {:#08x} failed to initialize with code {:#04x}\n", var,
|
FSFW_LOGWT("initialize: Object {:#010x} failed to initialize with code {:#06x}\n", var,
|
||||||
result);
|
result);
|
||||||
errorCount++;
|
errorCount++;
|
||||||
}
|
}
|
||||||
@ -91,7 +91,7 @@ void ObjectManager::initialize() {
|
|||||||
for (auto const& it : objectList) {
|
for (auto const& it : objectList) {
|
||||||
result = it.second->checkObjectConnections();
|
result = it.second->checkObjectConnections();
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
FSFW_LOGE("initialize: Object {:#08x} connection check failed with code {:#04x}\n", it.first,
|
FSFW_LOGE("initialize: Object {:#010x} connection check failed with code {:#06x}\n", it.first,
|
||||||
result);
|
result);
|
||||||
errorCount++;
|
errorCount++;
|
||||||
}
|
}
|
||||||
@ -106,7 +106,7 @@ void ObjectManager::printList() {
|
|||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::info("ObjectManager: Object List contains:\n");
|
sif::info("ObjectManager: Object List contains:\n");
|
||||||
for (auto const& it : objectList) {
|
for (auto const& it : objectList) {
|
||||||
sif::info("{:#08x} | {:#08x}\n", it.first, fmt::ptr(it.second));
|
sif::info("{:#010x} | {:#010x}\n", it.first, fmt::ptr(it.second));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,7 @@ ReturnValue_t FixedTimeslotTask::addSlot(object_id_t componentId, uint32_t slotT
|
|||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
FSFW_LOGE("addSlot: Component {:#08x} not found, not adding it to PST\n", componentId);
|
FSFW_LOGE("addSlot: Component {:#010x} not found, not adding it to PST\n", componentId);
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ ReturnValue_t Service20ParameterManagement::checkInterfaceAndAcquireMessageQueue
|
|||||||
auto* possibleTarget = ObjectManager::instance()->get<ReceivesParameterMessagesIF>(*objectId);
|
auto* possibleTarget = ObjectManager::instance()->get<ReceivesParameterMessagesIF>(*objectId);
|
||||||
if (possibleTarget == nullptr) {
|
if (possibleTarget == nullptr) {
|
||||||
FSFW_LOGE(
|
FSFW_LOGE(
|
||||||
"checkInterfaceAndAcquire: Can't retrieve message queue | Object ID {:#08x}\n"
|
"checkInterfaceAndAcquire: Can't retrieve message queue | Object ID {:#010x}\n"
|
||||||
"Does it implement ReceivesParameterMessagesIF?\n",
|
"Does it implement ReceivesParameterMessagesIF?\n",
|
||||||
*objectId);
|
*objectId);
|
||||||
return CommandingServiceBase::INVALID_OBJECT;
|
return CommandingServiceBase::INVALID_OBJECT;
|
||||||
|
@ -132,7 +132,7 @@ void Service2DeviceAccess::sendWiretappingTm(CommandMessage* reply, uint8_t subs
|
|||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
ReturnValue_t result = IPCStore->getData(storeAddress, &data, &size);
|
ReturnValue_t result = IPCStore->getData(storeAddress, &data, &size);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
FSFW_LOGW("sendWiretappingTm: Data Lost in handleUnrequestedReply with failure ID {:#04x}\n",
|
FSFW_LOGW("sendWiretappingTm: Data Lost in handleUnrequestedReply with failure ID {:#06x}\n",
|
||||||
result);
|
result);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ template <typename... T>
|
|||||||
size_t logTraced(LogLevel level, const char* file, unsigned int line, bool timed,
|
size_t logTraced(LogLevel level, const char* file, unsigned int line, bool timed,
|
||||||
fmt::format_string<T...> fmt, T&&... args) noexcept {
|
fmt::format_string<T...> fmt, T&&... args) noexcept {
|
||||||
if (PRINT_MUTEX == nullptr) {
|
if (PRINT_MUTEX == nullptr) {
|
||||||
fmt::print("Please call sif::initialize at program startup\n");
|
fmt::print("ERRROR | {} | Please call sif::initialize at program startup\n", __FILENAME__);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@ -74,7 +74,7 @@ size_t logTraced(LogLevel level, const char* file, unsigned int line, bool timed
|
|||||||
PRINT_MUTEX->unlockMutex();
|
PRINT_MUTEX->unlockMutex();
|
||||||
return bufPos;
|
return bufPos;
|
||||||
} catch (const fmt::v8::format_error& e) {
|
} catch (const fmt::v8::format_error& e) {
|
||||||
fmt::print("Printing failed with error: {}\n", e.what());
|
fmt::print("ERROR | {} | Printing failed with error: {}\n", __FILENAME__, e.what());
|
||||||
PRINT_MUTEX->unlockMutex();
|
PRINT_MUTEX->unlockMutex();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -83,7 +83,7 @@ size_t logTraced(LogLevel level, const char* file, unsigned int line, bool timed
|
|||||||
template <typename... T>
|
template <typename... T>
|
||||||
size_t log(LogLevel level, bool timed, fmt::format_string<T...> fmt, T&&... args) noexcept {
|
size_t log(LogLevel level, bool timed, fmt::format_string<T...> fmt, T&&... args) noexcept {
|
||||||
if (PRINT_MUTEX == nullptr) {
|
if (PRINT_MUTEX == nullptr) {
|
||||||
fmt::print("Please call sif::initialize at program startup\n");
|
fmt::print("ERROR | {} | Please call sif::initialize at program startup\n", __FILENAME__);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@ -118,16 +118,29 @@ size_t log(LogLevel level, bool timed, fmt::format_string<T...> fmt, T&&... args
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename... T>
|
template <typename... T>
|
||||||
void debug(const char* file, unsigned int line, fmt::format_string<T...> fmt,
|
void debug(fmt::format_string<T...> fmt, T&&... args) noexcept {
|
||||||
|
log(LogLevel::DEBUG, false, fmt, args...);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename... T>
|
||||||
|
void debug_t(fmt::format_string<T...> fmt, T&&... args) noexcept {
|
||||||
|
log(LogLevel::DEBUG, true, fmt, args...);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Debug logger with source file information
|
||||||
|
*/
|
||||||
|
template <typename... T>
|
||||||
|
void debug_s(const char* file, unsigned int line, fmt::format_string<T...> fmt,
|
||||||
T&&... args) noexcept {
|
T&&... args) noexcept {
|
||||||
logTraced(LogLevel::DEBUG, file, line, false, fmt, args...);
|
logTraced(LogLevel::DEBUG, file, line, false, fmt, args...);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Debug logger with timestamp and file/line number prefix
|
* Debug logger with source file information and timestamp
|
||||||
*/
|
*/
|
||||||
template <typename... T>
|
template <typename... T>
|
||||||
void debug_t(const char* file, unsigned int line, fmt::format_string<T...> fmt,
|
void debug_st(const char* file, unsigned int line, fmt::format_string<T...> fmt,
|
||||||
T&&... args) noexcept {
|
T&&... args) noexcept {
|
||||||
logTraced(LogLevel::DEBUG, file, line, true, fmt, args...);
|
logTraced(LogLevel::DEBUG, file, line, true, fmt, args...);
|
||||||
}
|
}
|
||||||
@ -209,17 +222,27 @@ void error_st(const char* file, unsigned int line, fmt::format_string<T...> fmt,
|
|||||||
} // namespace sif
|
} // namespace sif
|
||||||
|
|
||||||
// Helper macros to simplify calling the logger functions
|
// Helper macros to simplify calling the logger functions
|
||||||
// The macros prefixed with F can be used to print formatted output
|
|
||||||
// The macros postfixed with T are the log variant with timing information
|
// The macros postfixed with T are the log variant with timing information
|
||||||
|
|
||||||
#define FSFW_LOGI(...) sif::info(__VA_ARGS__)
|
#define FSFW_LOGI(...) sif::info(__VA_ARGS__)
|
||||||
#define FSFW_LOGIT(...) sif::info_t(__VA_ARGS__)
|
#define FSFW_LOGIT(...) sif::info_t(__VA_ARGS__)
|
||||||
|
|
||||||
#define FSFW_LOGD(...) sif::debug(__FILENAME__, __LINE__, __VA_ARGS__)
|
#define FSFW_LOGD(...) sif::debug_s(__FILENAME__, __LINE__, __VA_ARGS__)
|
||||||
#define FSFW_LOGDT(...) sif::debug_t(__FILENAME__, __LINE__, __VA_ARGS__)
|
#define FSFW_LOGDT(...) sif::debug_st(__FILENAME__, __LINE__, __VA_ARGS__)
|
||||||
|
|
||||||
#define FSFW_LOGW(...) sif::warning_s(__FILENAME__, __LINE__, __VA_ARGS__)
|
#define FSFW_LOGW(...) sif::warning_s(__FILENAME__, __LINE__, __VA_ARGS__)
|
||||||
#define FSFW_LOGWT(...) sif::warning_st(__FILENAME__, __LINE__, __VA_ARGS__)
|
#define FSFW_LOGWT(...) sif::warning_st(__FILENAME__, __LINE__, __VA_ARGS__)
|
||||||
|
|
||||||
#define FSFW_LOGE(...) sif::error_s(__FILENAME__, __LINE__, __VA_ARGS__)
|
#define FSFW_LOGE(...) sif::error_s(__FILENAME__, __LINE__, __VA_ARGS__)
|
||||||
#define FSFW_LOGET(...) sif::error_st(__FILENAME__, __LINE__, __VA_ARGS__)
|
#define FSFW_LOGET(...) sif::error_st(__FILENAME__, __LINE__, __VA_ARGS__)
|
||||||
|
|
||||||
|
// Using those reduced binary size marginally..
|
||||||
|
|
||||||
|
//#define FSFW_LOGD(...) sif::debug(__VA_ARGS__)
|
||||||
|
//#define FSFW_LOGDT(...) sif::debug_t(__VA_ARGS__)
|
||||||
|
|
||||||
|
//#define FSFW_LOGW(...) sif::warning(__VA_ARGS__)
|
||||||
|
//#define FSFW_LOGWT(...) sif::warning_t(__VA_ARGS__)
|
||||||
|
|
||||||
|
//#define FSFW_LOGE(...) sif::error(__VA_ARGS__)
|
||||||
|
//#define FSFW_LOGET(...) sif::error(__VA_ARGS__)
|
||||||
|
@ -199,7 +199,7 @@ ReturnValue_t LocalPool::reserveSpace(const size_t size, store_address_t* storeI
|
|||||||
bool ignoreFault) {
|
bool ignoreFault) {
|
||||||
ReturnValue_t status = getSubPoolIndex(size, &storeId->poolIndex);
|
ReturnValue_t status = getSubPoolIndex(size, &storeId->poolIndex);
|
||||||
if (status != RETURN_OK) {
|
if (status != RETURN_OK) {
|
||||||
FSFW_LOGW("ID {:#08x} | reserveSpace: Packet too large\n", SystemObject::getObjectId());
|
FSFW_LOGW("ID {:#010x} | reserveSpace: Packet too large\n", SystemObject::getObjectId());
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
status = findEmpty(storeId->poolIndex, &storeId->packetIndex);
|
status = findEmpty(storeId->poolIndex, &storeId->packetIndex);
|
||||||
|
@ -35,7 +35,7 @@ ReturnValue_t TcDistributor::handlePacket() {
|
|||||||
void TcDistributor::print() {
|
void TcDistributor::print() {
|
||||||
FSFW_LOGI("{}", "Distributor content is:\nID\t| Message Queue ID");
|
FSFW_LOGI("{}", "Distributor content is:\nID\t| Message Queue ID");
|
||||||
for (const auto& queueMapIter : queueMap) {
|
for (const auto& queueMapIter : queueMap) {
|
||||||
FSFW_LOGI("{} \t| {:#08x}", queueMapIter.first, queueMapIter.second);
|
FSFW_LOGI("{} \t| {:#010x}", queueMapIter.first, queueMapIter.second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ ReturnValue_t TmTcBridge::handleTm() {
|
|||||||
ReturnValue_t status = HasReturnvaluesIF::RETURN_OK;
|
ReturnValue_t status = HasReturnvaluesIF::RETURN_OK;
|
||||||
ReturnValue_t result = handleTmQueue();
|
ReturnValue_t result = handleTmQueue();
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
FSFW_LOGET("handleTm: Error handling TM queue with error code {:#04x}\n", result);
|
FSFW_LOGET("handleTm: Error handling TM queue with error code {:#06x}\n", result);
|
||||||
status = result;
|
status = result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,7 +183,7 @@ ReturnValue_t TmTcBridge::handleStoredTm() {
|
|||||||
|
|
||||||
result = sendTm(data, size);
|
result = sendTm(data, size);
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
FSFW_LOGW("handleStoredTm: Could not send stored downlink data, code {:#04x}\n", result);
|
FSFW_LOGW("handleStoredTm: Could not send stored downlink data, code {:#06x}\n", result);
|
||||||
status = result;
|
status = result;
|
||||||
}
|
}
|
||||||
packetSentCounter++;
|
packetSentCounter++;
|
||||||
|
@ -80,7 +80,7 @@ void VerificationReporter::sendFailureReport(uint8_t report_id, uint8_t ackFlags
|
|||||||
step, parameter1, parameter2);
|
step, parameter1, parameter2);
|
||||||
ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue, &message);
|
ReturnValue_t status = MessageQueueSenderIF::sendMessage(acknowledgeQueue, &message);
|
||||||
if (status != HasReturnvaluesIF::RETURN_OK) {
|
if (status != HasReturnvaluesIF::RETURN_OK) {
|
||||||
FSFW_LOGE("sendFailureReport: Error writing to queue. Code {:#04x}\n", status);
|
FSFW_LOGE("sendFailureReport: Error writing to queue. Code {:#06x}\n", status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user