Go to the documentation of this file.
16 if (backends ==
NULL) {
18 fprintf(stream,
"backends cannot be NULL\n");
25 fprintf(stream,
"Couldn't malloc olog\n");
30 for (
int i = 0;;
i++) {
31 if (!(backends[
i].print_callback || backends[
i].destroy_callback)) {
37 fprintf(stream,
"Couldn't malloc backends\n");
41 memcpy(o->
backends, backends, backends_size);
107 va_copy(args_tmp,
args);
125 #define define_olog_print(name, level) \
126 int olog_ ## name(olog *olog, ...){ \
128 va_start(args, olog); \
129 int ret = olog_vprint(olog, level, args); \
olog * olog_create(olog_backend *backends, FILE *stream)
int8_t min_log_level
Minimum log level to receive.
olog_print_error_callback print_error_callback
Called to print an error, if one exists.
A simple logger, capable of dispatching log events to multiple end points.
olog_has_error_callback has_error_callback
Called to check if backend is valid.
bool olog_print_error(olog *olog, FILE *stream)
int olog_vprint(olog *olog, int8_t level, va_list args)
a context in which it is NOT documented to do so subscript error
olog * olog_load_default()
int olog_print(olog *olog, int level,...)
bool olog_has_error(olog *olog)
olog_destroy_callback destroy_callback
Called when olog object is destroyed.
int8_t max_log_level
Maximum log level to receive.
olog_print_callback print_callback
Called when given data to print.
#define define_olog_print(name, level)
void olog_destroy(olog *olog)