-
Notifications
You must be signed in to change notification settings - Fork 3
Error Logging
The logging queue is intended for brief error logs, equivalent to an error code.
To log to file, first use addLogItem()
to add an item to xLoggingQueue. The arguments are:
- LogType_t - enum that specifies type of log
- EncodedMessage_t - enum that encodes details with associated LogType_t
Enums are defined in "sfu_task_logging.h"
A reference document is available here: https://docs.google.com/document/d/1VdZ2ZLdfByL5thwYg4ggyNYvPFjmcHge-LwsazGSZjg/edit?usp=sharing
The method addLogItem()
also automatically timestamps when an item is added.
Example:
#include "sfu_task_logging.h"
addLogItem(logtype_1, details_1);
The number of items that the queue accepts is limited by LOGGING_QUEUE_LENGTH
in sfu_task_logging.h. It is currently 20.
If the queue is full, addLogItem()
returns errQUEUE_FULL and will not log the current item.
The task vLogToFileTask is started in sfu_task_main.c to automatically receive items from xLoggingQueue. When the task finds an item available, it is received from the queue and logged into the filesystem.