Thread safe printing API.
More...
Thread safe printing API.
Provides replacements for printf
and fprintf
with the two functions prints
and fprints
, standing for "print safe".
Both functions are variadic and wrap the standard print functions, meaning their use is identical and as such the documentations for printf
and fprintf
can be used as reference.
The functions also allow writing to any IO stream, prints
is simply a call to fprints
where the IO stream is fixed to stdout
,
◆ PRINT_ERROR
#define PRINT_ERROR |
( |
|
msg, |
|
|
|
... |
|
) |
| |
Value: fprintf(stderr, "[ERROR] " msg, ##__VA_ARGS__); \
fprintf(stderr, " @-> %s:%d, %s\n", __FILE__, __LINE__, __func__)
◆ PRINT_TASK_ERROR
#define PRINT_TASK_ERROR |
( |
|
task | ) |
PRINT_ERROR("Failed to print task ##task"); |
◆ SAFE_PRINT_INPUT_BUFFER_COUNT
#define SAFE_PRINT_INPUT_BUFFER_COUNT 10 |
◆ SAFE_PRINT_MAX_MSG_LEN
#define SAFE_PRINT_MAX_MSG_LEN 256 |
◆ SAFE_PRINT_PRIORITY
#define SAFE_PRINT_PRIORITY tskIDLE_PRIORITY |
◆ SAFE_PRINT_QUEUE_LEN
#define SAFE_PRINT_QUEUE_LEN 20 |
◆ SAFE_PRINT_STACK_SIZE
◆ fprints()
void fprints |
( |
FILE *__restrict |
__stream, |
|
|
const char * |
__format, |
|
|
|
... |
|
) |
| |
Prints a formatted string to the specifed IO stream.
- Parameters
-
__stream | IO stream to print to, eg. stdio or stderr |
__format | Formatting string to be printed |
◆ gfxSafePrintExit()
void gfxSafePrintExit |
( |
void |
| ) |
|
Exits the printing module.
◆ gfxSafePrintInit()
int gfxSafePrintInit |
( |
void |
| ) |
|
Initializes the printing module.
- Returns
- 0 on sucess
◆ prints()
void prints |
( |
const char * |
__format, |
|
|
|
... |
|
) |
| |
Prints a formatted string to stdout
- Parameters
-
__format | Formatting string to be printed |