STASIS
A pipeline delivery generator
Loading...
Searching...
No Matches
log.h
1#ifndef STASIS_EXECPOINT_H
2#define STASIS_EXECPOINT_H
3
4#include <stdio.h>
5
6enum LogLevel {
7 LOG_LEVEL_WARN = 0,
8 LOG_LEVEL_INFO,
9 LOG_LEVEL_DEBUG,
10};
11extern enum LogLevel LOG_LEVEL;
12
13struct ExecPoint {
14 const int line; // line number
15 const char *file; // file name of origin
16 const char *function; // function of origin
17};
18
19#define EXECPOINT (struct ExecPoint) {.line = __LINE__, .file = __FILE__, .function = __func__}
20
21void log_print_error(struct ExecPoint ep, const char *fmt, ...);
22void log_print_warning(struct ExecPoint ep, const char *fmt, ...);
23void log_print_info(struct ExecPoint ep, const char *fmt, ...);
24void log_print_debug(struct ExecPoint ep, const char *fmt, ...);
25int log_msgv(FILE *stream, struct ExecPoint ep, const char *preface_color, const char *preface, const char *fmt, va_list ap);
26int log_msg(FILE *stream, struct ExecPoint ep, const char *preface_color, const char *preface, const char *fmt, ...);
27const char *log_get_level_str(void);
28
29#endif // STASIS_EXECPOINT_H
Definition log.h:13