can_slogf()
Log CAN slog2 message
Synopisis
#include <hw/libcan.h>
#include <sys/slog2.h>
void can_slogf( const int level,
const char *fmt,
... );Arguments
- level
The logging level. One of:
- fmt
A printf()-formatted character string used to define the log, followed by any additional arguments, as required.
Description
The can_slogf() function logs a printf()-style ASCII-text string in the CAN slog2 buffer. By default, the buffer accepts strings up to 512 bytes in length, but you can configure the length in the slogger2 configuration or SLOG2_MAX_LOG_SIZE environment variable. If the formatted string and its printf() arguments exceed the set limit, the string is truncated. A plain string without arguments can extend to the maximum accepted string size.
If you call can_slogf() before can_resmgr_init() returns successfully, the string is printed to standard error or discarded, depending on the driver verbosity and log level.
