22#define DC_LOG_ANSI_RESET "\033[0m"
23#define DC_LOG_ANSI_PURPLE "\033[35m"
24#define DC_LOG_ANSI_BLUE "\033[34m"
25#define DC_LOG_ANSI_GREEN "\033[32m"
26#define DC_LOG_ANSI_ORANGE "\033[33m"
27#define DC_LOG_ANSI_RED "\033[31m"
46 if (level < self->
filter) {
49 if (self->
parent != NULL) {
60 if (self->
parent != NULL) {
69#if defined(__clang__) || defined(__GNUC__)
70 __attribute__((format(printf, 4, 5)))
85 fprintf(self->
stream,
"[");
89 fprintf(self->
stream,
"] ");
104 fprintf(self->
stream,
"\n");
145 fprintf(
stream,
"dc_log_file@%p {\n", (
void const*)self);
149 if (self->
parent != NULL) {
167#if !defined DC_LOGGER
168 #define DC_LOGGER dc_log_file
#define DC_DEBUG(DEBUG_FN, DEBUG_PTR)
static DC_PUBLIC dc_log_file dc_log_file_from_parent(dc_log_file *parent, dc_log_id id)
static DC_PUBLIC dc_log_level dc_log_file_get_filter(dc_log_file const *self)
#define DC_LOG_ANSI_ORANGE
static DC_PUBLIC void dc_log_file_debug(dc_log_file const *self, dc_debug_fmt fmt, FILE *stream)
#define DC_LOG_ANSI_RESET
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_INTERNAL char const * dc_log_level_ansi_colour(dc_log_level level)
struct _dc_log_file dc_log_file
static DC_PUBLIC void dc_log_file_delete(dc_log_file *self)
#define DC_LOG_ANSI_PURPLE
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,...)
#define DC_LOG_ANSI_GREEN
static DC_PUBLIC bool dc_log_file_should_log(dc_log_file const *self, dc_log_level level)
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)
struct _dc_log_file * parent
Debug format helpers for debug printin data structures.
char name[DC_LOG_ID_LENGTH]
static DC_PUBLIC dc_datetime dc_datetime_now_utc(void)
static DC_PUBLIC void dc_datetime_format(dc_datetime const *dt, FILE *stream)
static DC_PUBLIC char const * dc_log_level_to_string(dc_log_level level)
#define DC_TRAIT_LOGGER(SELF)
static DC_PUBLIC FILE * stream(SELF *self)