slog2f()
Log a printf-style string in a slog2 buffer
Synopsis:
#include <slog2.h> int slog2f( slog2_buffer_t buffer, uint16_t code, uint8_t severity, const char* format, ... );
Arguments:
- buffer
- The handle of the buffer you want to log the message in, or NULL to use the default buffer that you specified earlier with slog2_set_default_buffer().
- code
- A user-specified code that you want to be associated with the message. The slog2 system doesn't interpret this code in any way.
- severity
- The severity level of this log item; one of:
- SLOG2_SHUTDOWN
- SLOG2_CRITICAL
- SLOG2_ERROR
- SLOG2_WARNING
- SLOG2_NOTICE
- SLOG2_INFO
- SLOG2_DEBUG1
- SLOG2_DEBUG2
For more information, see the entry for slog2_register().
- format
- A printf-formatted character string used to define the log, followed by any additional arguments, as required.
Description:
The slog2f() function logs a printf-style ASCII-text string in the specified slog2 buffer.
The vslog2f() function is an alternate form in which the arguments have already been captured using the variable-length argument facilities of <stdarg.h>.
Returns:
0 on success, or -1 if an error occurred.
Examples:
See slog2_register().
Classification:
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | Read the Caveats |
| Signal handler | Yes |
| Thread | Yes |
Caveats:
Don't use double or float arguments in an interrupt handler, unless your code is compiled to use software floating-point emulation.