~fluix/periodicus

periodicus/log.h -rw-r--r-- 681 bytes
9fa32d88Steven Guikal Improve Makefile 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdio.h>
#include <stdarg.h>

#define BLURT(msg) \
	fprintf(stdout, "[\033[1;36mBLURT\033[0m] (%s:%d) %s" msg "\n", __FILE__, __LINE__, __func__);

#define DEBUG(format, ...) \
	fprintf(stdout, "[\033[0;35mDEBUG\033[0m] (%s:%d) " format "\n", __FILE__, __LINE__, ##__VA_ARGS__);

#define INFO(format, ...) \
	fprintf(stdout, "[\033[0;34mINFO\033[0m] (%s:%d) " format "\n", __FILE__, __LINE__, ##__VA_ARGS__);

#define WARN(format, ...) \
	fprintf(stdout, "[\033[0;33mWARN\033[0m] (%s:%d) " format "\n", __FILE__, __LINE__, ##__VA_ARGS__);

#define ERROR(format, ...) \
	fprintf(stderr, "[\033[0;31mERROR\033[0m] (%s:%d) " format "\n", __FILE__, __LINE__, ##__VA_ARGS__);