Bluenet
5.7.0
Bluenet, firmware for nRF52 smart home devices
|
Go to the source code of this file.
Macros | |
#define | _clog(level, addNewLine, fmt, ...) |
Logger class for C code. More... | |
#define | CLOGvv(fmt, ...) _clog(SERIAL_VERY_VERBOSE, true, fmt, ##__VA_ARGS__) |
#define | CLOGv(fmt, ...) _clog(SERIAL_VERBOSE, true, fmt, ##__VA_ARGS__) |
#define | CLOGd(fmt, ...) _clog(SERIAL_DEBUG, true, fmt, ##__VA_ARGS__) |
#define | CLOGi(fmt, ...) _clog(SERIAL_INFO, true, fmt, ##__VA_ARGS__) |
#define | CLOGw(fmt, ...) _clog(SERIAL_WARN, true, fmt, ##__VA_ARGS__) |
#define | CLOGe(fmt, ...) _clog(SERIAL_ERROR, true, fmt, ##__VA_ARGS__) |
#define | CLOGf(fmt, ...) _clog(SERIAL_FATAL, true, fmt, ##__VA_ARGS__) |
Functions | |
void | cs_clog (bool addNewLine, const char *fmt,...) |
#define _clog | ( | level, | |
addNewLine, | |||
fmt, | |||
... | |||
) |
Logger class for C code.
Generally, you want to use: CLOGv, CLOGd, CLOGi, CLOGw, CLOGe, or CLOGf. These can be used like printf(), but without padding, flags, width, or other specifier.
The logs will always be written to UART in plain text.
Since the log functions have an unknown amount of arguments, these macros require a variadic macro as well. See http://www.wikiwand.com/en/Variadic_macro. The two ## are e.g. a gcc specific extension that removes the , so that the ... arguments can also be left out.
#define CLOGd | ( | fmt, | |
... | |||
) | _clog(SERIAL_DEBUG, true, fmt, ##__VA_ARGS__) |
#define CLOGe | ( | fmt, | |
... | |||
) | _clog(SERIAL_ERROR, true, fmt, ##__VA_ARGS__) |
#define CLOGf | ( | fmt, | |
... | |||
) | _clog(SERIAL_FATAL, true, fmt, ##__VA_ARGS__) |
#define CLOGi | ( | fmt, | |
... | |||
) | _clog(SERIAL_INFO, true, fmt, ##__VA_ARGS__) |
#define CLOGv | ( | fmt, | |
... | |||
) | _clog(SERIAL_VERBOSE, true, fmt, ##__VA_ARGS__) |
#define CLOGvv | ( | fmt, | |
... | |||
) | _clog(SERIAL_VERY_VERBOSE, true, fmt, ##__VA_ARGS__) |
#define CLOGw | ( | fmt, | |
... | |||
) | _clog(SERIAL_WARN, true, fmt, ##__VA_ARGS__) |
void cs_clog | ( | bool | addNewLine, |
const char * | fmt, | ||
... | |||
) |