MCU-Common
Modules useful for embedded (MCU) programming
|
Go to the source code of this file.
Data Structures | |
struct | logger_entry |
Logger entry (used internally) More... | |
struct | logger |
Logger instance. More... | |
Macros | |
#define | LOGGER_PUT_IMPL_N(n) LOGGER_PUT_ARGC##n |
#define | LOGGER_PUT_IMPL(log, argc, ...) LOGGER_PUT_IMPL_N(argc)(log, __VA_ARGS__) |
#define | LOGGER_PUT_ARGC1(log, fmt) logger_put0((log), (fmt)) |
#define | LOGGER_PUT_ARGC2(log, fmt, a0) logger_put1((log), (fmt), (int)(a0)) |
#define | LOGGER_PUT_ARGC3(log, fmt, a0, a1) logger_put2((log), (fmt), (int)(a0), (int)(a1)) |
#define | LOGGER_PUT_ARGC4(log, fmt, a0, a1, a2) logger_put3((log), (fmt), (int)(a0), (int)(a1), (int)(a2)) |
#define | LOGGER_PUT_ARGC5(log, fmt, a0, a1, a2, a3) logger_put4((log), (fmt), (int)(a0), (int)(a1), (int)(a2), (int)(a3)) |
#define | LOGGER_PUT_ARGC6(log, fmt, a0, a1, a2, a3, a4) logger_put5((log), (fmt), (int)(a0), (int)(a1), (int)(a2), (int)(a3), (int)(a4)) |
#define | LOGGER_PUT_ARGC7(log, fmt, a0, a1, a2, a3, a4, a5) logger_put6((log), (fmt), (int)(a0), (int)(a1), (int)(a2), (int)(a3), (int)(a4), (int)(a5)) |
#define | LOGGER_MAX_ARGC 6 |
The maximum number of logger_put() arguments supported by the implementation. More... | |
#define | LOGGER_INIT(log, log_write_cb, log_capacity, str_capacity) |
Initializes the logger instance and allocates its string and FIFO buffers. More... | |
#define | LOGGER_PUT(log, ...) logger_put(log, VA_ARGC(__VA_ARGS__), __VA_ARGS__) |
Logs a message. More... | |
Functions | |
bool | logger_init (struct logger *log) |
Initializes logger. More... | |
bool | logger_put (const struct logger *log, int argc, const char *fmt,...) |
Logs a message (puts it into internal buffer for later processing). More... | |
bool | logger_process (const struct logger *log) |
Processes a single logged message from the buffer. More... | |
bool | logger_put0 (const struct logger *log, const char *fmt) |
Inserts a message to the logger. More... | |
bool | logger_put1 (const struct logger *log, const char *fmt, int arg0) |
Inserts a message to the logger. More... | |
bool | logger_put2 (const struct logger *log, const char *fmt, int arg0, int arg1) |
Inserts a message to the logger. More... | |
bool | logger_put3 (const struct logger *log, const char *fmt, int arg0, int arg1, int arg2) |
Inserts a message to the logger. More... | |
bool | logger_put4 (const struct logger *log, const char *fmt, int arg0, int arg1, int arg2, int arg3) |
Inserts a message to the logger. More... | |
bool | logger_put5 (const struct logger *log, const char *fmt, int arg0, int arg1, int arg2, int arg3, int arg4) |
Inserts a message to the logger. More... | |
bool | logger_put6 (const struct logger *log, const char *fmt, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5) |
Inserts a message to the logger. More... | |
#define LOGGER_PUT_IMPL_N | ( | n | ) | LOGGER_PUT_ARGC##n |
#define LOGGER_PUT_IMPL | ( | log, | |
argc, | |||
... | |||
) | LOGGER_PUT_IMPL_N(argc)(log, __VA_ARGS__) |
#define LOGGER_PUT_ARGC1 | ( | log, | |
fmt | |||
) | logger_put0((log), (fmt)) |
#define LOGGER_PUT_ARGC2 | ( | log, | |
fmt, | |||
a0 | |||
) | logger_put1((log), (fmt), (int)(a0)) |
#define LOGGER_PUT_ARGC3 | ( | log, | |
fmt, | |||
a0, | |||
a1 | |||
) | logger_put2((log), (fmt), (int)(a0), (int)(a1)) |
#define LOGGER_PUT_ARGC4 | ( | log, | |
fmt, | |||
a0, | |||
a1, | |||
a2 | |||
) | logger_put3((log), (fmt), (int)(a0), (int)(a1), (int)(a2)) |
#define LOGGER_PUT_ARGC5 | ( | log, | |
fmt, | |||
a0, | |||
a1, | |||
a2, | |||
a3 | |||
) | logger_put4((log), (fmt), (int)(a0), (int)(a1), (int)(a2), (int)(a3)) |
#define LOGGER_PUT_ARGC6 | ( | log, | |
fmt, | |||
a0, | |||
a1, | |||
a2, | |||
a3, | |||
a4 | |||
) | logger_put5((log), (fmt), (int)(a0), (int)(a1), (int)(a2), (int)(a3), (int)(a4)) |
#define LOGGER_PUT_ARGC7 | ( | log, | |
fmt, | |||
a0, | |||
a1, | |||
a2, | |||
a3, | |||
a4, | |||
a5 | |||
) | logger_put6((log), (fmt), (int)(a0), (int)(a1), (int)(a2), (int)(a3), (int)(a4), (int)(a5)) |
bool logger_put0 | ( | const struct logger * | log, |
const char * | fmt | ||
) |
Inserts a message to the logger.
log | Pointer to the logger structure |
fmt | Pointer to a formatted string (for sprintf ) |
true
if message was put inserted successfully, false
otherwise bool logger_put1 | ( | const struct logger * | log, |
const char * | fmt, | ||
int | arg0 | ||
) |
Inserts a message to the logger.
log | Pointer to the logger structure |
fmt | Pointer to a formatted string to be passed to sprintf |
arg0 | Argument to be passed to sprintf |
true
if message was put inserted successfully, false
otherwise bool logger_put2 | ( | const struct logger * | log, |
const char * | fmt, | ||
int | arg0, | ||
int | arg1 | ||
) |
Inserts a message to the logger.
log | Pointer to the logger structure |
fmt | Pointer to a formatted string to be passed to sprintf |
arg0,arg1 | Arguments to be passed to sprintf |
true
if message was put inserted successfully, false
otherwise bool logger_put3 | ( | const struct logger * | log, |
const char * | fmt, | ||
int | arg0, | ||
int | arg1, | ||
int | arg2 | ||
) |
Inserts a message to the logger.
log | Pointer to the logger structure |
fmt | Pointer to a formatted string to be passed to sprintf |
arg0,arg1,arg2 | Arguments to be passed to sprintf |
true
if message was put inserted successfully, false
otherwise bool logger_put4 | ( | const struct logger * | log, |
const char * | fmt, | ||
int | arg0, | ||
int | arg1, | ||
int | arg2, | ||
int | arg3 | ||
) |
Inserts a message to the logger.
log | Pointer to the logger structure |
fmt | Pointer to a formatted string to be passed to sprintf |
arg0,arg1,arg2,arg3 | Arguments to be passed to sprintf |
true
if message was put inserted successfully, false
otherwise bool logger_put5 | ( | const struct logger * | log, |
const char * | fmt, | ||
int | arg0, | ||
int | arg1, | ||
int | arg2, | ||
int | arg3, | ||
int | arg4 | ||
) |
Inserts a message to the logger.
log | Pointer to the logger structure |
fmt | Pointer to a formatted string to be passed to sprintf |
arg0,arg1,arg2,arg3,arg4 | Arguments to be passed to sprintf |
true
if message was put inserted successfully, false
otherwise bool logger_put6 | ( | const struct logger * | log, |
const char * | fmt, | ||
int | arg0, | ||
int | arg1, | ||
int | arg2, | ||
int | arg3, | ||
int | arg4, | ||
int | arg5 | ||
) |
Inserts a message to the logger.
log | Pointer to the logger structure |
fmt | Pointer to a formatted string to be passed to sprintf |
arg0,arg1,arg2,arg3,arg4,arg5 | Arguments to be passed to sprintf |
true
if message was put inserted successfully, false
otherwise