29 #define ERROR_MSG "%s:%d: "
30 #define ERROR_POS __FILE__, __LINE__
31 #define ERROR_FUNC __FUNCTION__, __LINE__
61 #define ERROR_FINISH(ret, err, label_finish) \
63 void *_label_finish=&&label_finish; \
65 goto *_label_finish; \
73 #define DEFCOL "\033[0m"
74 #define BLACK(x) "\033[0;30m" x DEFCOL
75 #define RED(x) "\033[0;31m" x DEFCOL
76 #define GREEN(x) "\033[0;32m" x DEFCOL
77 #define BROWN(x) "\033[0;33m" x DEFCOL
78 #define BLUE(x) "\033[0;34m" x DEFCOL
79 #define PURPLE(x) "\033[0;35m" x DEFCOL
80 #define CYAN(x) "\033[0;36m" x DEFCOL
81 #define LIGHTGRAY(x) "\033[0;37m" x DEFCOL
82 #define DARKGRAY(x) "\033[1;30m" x DEFCOL
83 #define LIGHTRED(x) "\033[1;31m" x DEFCOL
84 #define LIGHTGREEN(x) "\033[1;32m" x DEFCOL
85 #define YELLOW(x) "\033[1;33m" x DEFCOL
86 #define LIGHTBLUE(x) "\033[1;34m" x DEFCOL
87 #define MAGENTA(x) "\033[1;35m" x DEFCOL
88 #define LIGHTCYAN(x) "\033[1;36m" x DEFCOL
89 #define WHITE(x) "\033[1;37m" x DEFCOL
98 #define LIGHTGRAY(x) x
100 #define LIGHTRED(x) x
101 #define LIGHTGREEN(x) x
103 #define LIGHTBLUE(x) x
105 #define LIGHTCYAN(x) x
114 void fatal(
const char *, ...) __attribute__ ((noreturn));
115 void error(const
char *, ...);
116 void loginfo(const
char *, ...);
117 void debug(
int lvl, const
char *, ...);
119 void print_log(
int level, const
char *fmt, va_list args);
void print_log(int level, const char *fmt, va_list args)
Definition: log.c:179
void fatal(const char *,...) __attribute__((noreturn))
Definition: log.c:94
void close_log_file(void)
Definition: log.c:85
void debug(int lvl, const char *,...)
Definition: log.c:162
void log_init(char *, int, int)
Definition: log.c:40
int log_to_file(char *filename)
Definition: log.c:62
void loginfo(const char *,...)
Definition: log.c:141
void error(const char *,...)
Definition: log.c:125