Go to the source code of this file.
|
| static DC_INTERNAL char const * | dc_log_level_ansi_colour (dc_log_level level) |
| static DC_PUBLIC bool | dc_log_file_should_log (dc_log_file const *self, dc_log_level level) |
| static DC_PUBLIC dc_log_level | dc_log_file_get_filter (dc_log_file const *self) |
| static DC_INTERNAL void | dc_log_file_print_descriptor (dc_log_file const *self, FILE *stream) |
| static DC_PUBLIC void | dc_log_file_log (dc_log_file *self, dc_log_location location, dc_log_level level, const char *const message,...) |
| static DC_PUBLIC void | dc_log_file_set_filter (dc_log_file *self, dc_log_level level) |
| static DC_PUBLIC dc_log_file | dc_log_file_new_global (dc_log_file_global_config config, dc_log_id id) |
| static DC_PUBLIC dc_log_file | dc_log_file_from_parent (dc_log_file *parent, dc_log_id id) |
| static DC_PUBLIC void | dc_log_file_delete (dc_log_file *self) |
| static DC_PUBLIC void | dc_log_file_debug (dc_log_file const *self, dc_debug_fmt fmt, FILE *stream) |
| | DC_TRAIT_LOGGER (dc_log_file) |
◆ DC_LOG_ANSI_BLUE
| #define DC_LOG_ANSI_BLUE "\033[34m" |
◆ DC_LOG_ANSI_GREEN
| #define DC_LOG_ANSI_GREEN "\033[32m" |
◆ DC_LOG_ANSI_ORANGE
| #define DC_LOG_ANSI_ORANGE "\033[33m" |
◆ DC_LOG_ANSI_PURPLE
| #define DC_LOG_ANSI_PURPLE "\033[35m" |
◆ DC_LOG_ANSI_RED
| #define DC_LOG_ANSI_RED "\033[31m" |
◆ DC_LOG_ANSI_RESET
| #define DC_LOG_ANSI_RESET "\033[0m" |
◆ DC_LOGGER
- Examples
- complex/employees.c, complex/prime_sieve.c, container/arena.c, container/bitset.c, container/map.c, container/queue.c, container/set.c, container/vector.c, utils/log.c, utils/option.c, utils/result.c, and utils/string_builder.c.
Definition at line 168 of file file.h.
◆ dc_log_file
◆ dc_log_file_debug()
- Examples
- utils/log.c.
Definition at line 144 of file file.h.
144 {
145 fprintf(
stream,
"dc_log_file@%p {\n", (
void const*)self);
147
149 if (self->parent != NULL) {
151 } else {
153 }
155
160
163}
static DC_PUBLIC void dc_log_file_debug(dc_log_file const *self, dc_debug_fmt fmt, FILE *stream)
static DC_PUBLIC void dc_debug_fmt_print(dc_debug_fmt fmt, FILE *stream, const char *format,...)
static DC_PUBLIC dc_debug_fmt dc_debug_fmt_scope_end(dc_debug_fmt fmt)
static DC_PUBLIC dc_debug_fmt dc_debug_fmt_scope_begin(dc_debug_fmt fmt)
static DC_PUBLIC char const * dc_log_level_to_string(dc_log_level level)
static DC_PUBLIC FILE * stream(SELF *self)
◆ dc_log_file_delete()
Definition at line 140 of file file.h.
140 {
142}
static DC_PUBLIC void dc_log_file_log(dc_log_file *self, dc_log_location location, dc_log_level level, const char *const message,...)
◆ dc_log_file_from_parent()
Definition at line 128 of file file.h.
128 {
130 .parent = parent,
132 .id = id,
135 };
137 return self;
138}
struct _dc_log_file dc_log_file
◆ dc_log_file_get_filter()
Definition at line 55 of file file.h.
55 {
56 return self->filter;
57}
◆ dc_log_file_log()
Definition at line 74 of file file.h.
75 {
77 return;
78 }
79
82 }
83
85 fprintf(self->
stream,
"[");
89 fprintf(self->
stream,
"] ");
90
91 va_list args;
94 va_end(args);
95
98 }
99
102 }
103
104 fprintf(self->
stream,
"\n");
106}
#define DC_DEBUG(DEBUG_FN, DEBUG_PTR)
#define DC_LOG_ANSI_RESET
static DC_INTERNAL char const * dc_log_level_ansi_colour(dc_log_level level)
static DC_INTERNAL void dc_log_file_print_descriptor(dc_log_file const *self, FILE *stream)
static DC_PUBLIC bool dc_log_file_should_log(dc_log_file const *self, dc_log_level level)
static DC_PUBLIC dc_datetime dc_datetime_now_utc(void)
static DC_PUBLIC void dc_datetime_format(dc_datetime const *dt, FILE *stream)
◆ dc_log_file_new_global()
Definition at line 115 of file file.h.
116 {
118 .parent = NULL,
120 .id = id,
123 };
125 return self;
126}
◆ dc_log_file_print_descriptor()
Definition at line 59 of file file.h.
59 {
60 if (self->parent != NULL) {
63 }
64 fprintf(
stream,
"%s", self->id.name);
65}
◆ dc_log_file_set_filter()
◆ dc_log_file_should_log()
Definition at line 45 of file file.h.
45 {
46 if (level < self->filter) {
47 return false;
48 }
49 if (self->parent != NULL) {
51 }
52 return true;
53}
◆ dc_log_level_ansi_colour()
Definition at line 29 of file file.h.
29 {
30 switch (level) {
41 }
43}
#define DC_LOG_ANSI_ORANGE
#define DC_LOG_ANSI_PURPLE
#define DC_LOG_ANSI_GREEN
◆ DC_TRAIT_LOGGER()