Artifact 1b046527ed7a9f2a6d9eafa9fc7ceeddd069d68bc45bfdf9fdfd00fa62efef74:
- File wgsync/src/def.c — part of check-in [81321a2c01] at 2022-11-01 14:33:33 on branch trunk — iterate, add linked list template (user: lexi, size: 434) [annotate] [blame] [check-ins using]
#include "def.h" #include <stdio.h> #include <unistd.h> uint8_t g_loglevel = #ifdef _cfg_debug 4 #else 3 #endif ; char thread_local g_logbuf [sizeof g_logbuf]; void msg ( uint8_t level, char* tag, uint8_t color, char* msg ) { if(level > g_loglevel) return; if(isatty(fileno(stderr))) { fprintf(stderr, "\x1b[1;3%cm(%s)\x1b[m %s\n", 0x30 + color, tag, msg); } else { fprintf(stderr, "(%s) %s\n", tag, msg); } }