This repository was archived by the owner on May 26, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Log System #39
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Add customized log logic. Possible interface could be:
Log_Info("msg");
Log_Error("msg");
Log_Warning("msg");
The log system gives detialed runtime information and therefore with help with debug. Some examples:
Consider a logic that waits for CAN bus mailbox availability, if the wait time exceeds threshold, it means something goes wrong. The only noticeable behavior in such case might just be a non-working motor. However given only the external behavior would be hard to precisely and efficiently locate the issue.
This is how it used to be like
while (HAL_CAN_GetTxMailboxesFreeLevel(&hcan2) == 0);
possible implementation of logging system
while (HAL_CAN_GetTxMailboxesFreeLevel(&hcan2) == 0) {
Log_Warning("[can bsp] can mailbox full. CAN send data pending.");
if (pending_time > PENDING_ERROR_THRESHOLD_TIME) {
Log_Error("[can bsp] can mailbox is really unhappy for %f s.", pending_time);
}
}
another example would be receiving CAN frame with unregistered CAN id
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers