]> git.itanic.dy.fi Git - log-plotter/blob - debug.h
data: Move the total charge field at the end of the data
[log-plotter] / debug.h
1 #ifndef __DEBUG_H
2 #define __DEBUG_H
3
4 extern int trace_level;
5
6 enum {
7         TRACE_ERR = 1,
8         TRACE_WARN,
9         TRACE_INFO,
10         TRACE_DEBUG,
11         TRACE_MAX,
12 };
13
14 void  __attribute__ ((__format__ (__printf__, 4, 5)))
15 print_trace(const char *file, int line, int l,
16                 const char *fmt, ...);
17
18 #define pr_err(arg...)   print_trace(__FILE__, __LINE__, TRACE_ERR, arg)
19 #define pr_warn(arg...)  print_trace(__FILE__, __LINE__, TRACE_WARN, arg)
20 #define pr_info(arg...)  print_trace(__FILE__, __LINE__, TRACE_INFO, arg)
21 #define pr_debug(arg...) print_trace(__FILE__, __LINE__, TRACE_DEBUG, arg)
22
23 #endif