Make the log functionalities more flexible
Description
The current log module is tightly linked to C99 functionalities like fopen
, fprintf
, vfrpintf
, ...
Uses of such functions are meaningless on embed systems without file system.
It would be more useful to redirect the logs to the standard output in this case, or to another log system (see #545 (closed)).
Analysis
The log mechanism can be overridden by re-implementing the functions exposed by sopc_log_manager.h
.
Fixes
The goal of these changes is to provide a redirection to the standard output in the context of the FreeRTOS development (see #599 (closed)). It only needs to be done at compile time. The following changes will be made:
- move the
sopc_log_manager
interface tohelpers_platform_dep
, - rename the current implementation from
SOPC_Log_
toSOPC_LogRotate_
(or similar), - use the log rotate implementation for the log manager under Linux and Windows (through
#defines
for instance), - create a lighter implementation that redirects logs to
vprintf
.
As the currently used C library for FreeRTOS projects provides implementations for fopen
, ..., it is possible to leave the SOPC_LogRotate
implementation in the common code of helpers_platform_dep
.