source: titan/titan/debug.h @ 11417

Last change on this file since 11417 was 11417, checked in by nit, 12 years ago

next update

File size: 981 bytes
RevLine 
[7497]1#ifndef DEBUG_H
2#define DEBUG_H
3
4short debug_level = 10;
5
[8010]6// mc debug_level = 50;
[11417]7// panel debug_level = 60;
[8010]8
[9488]9//first line shows greater/same debuglevel
10//second line shows only same debuglevel
[7506]11//#define debug(level, fmt, args...) if(debug_level >= level) { do { printf("[%s] " fmt, PROGNAME, ##args); } while (0); printf(", file=%s, func=%s, line=%d\n", __FILE__, __FUNCTION__, __LINE__); }
12#define debug(level, fmt, args...) if(debug_level == level) { do { printf("[%s] " fmt, PROGNAME, ##args); } while (0); printf(", file=%s, func=%s, line=%d\n", __FILE__, __FUNCTION__, __LINE__); }
[7497]13
14#define err(fmt, args...) { do { fprintf(stderr, "[%s] error: " fmt, PROGNAME, ##args); } while (0); fprintf(stderr, ", file=%s, func=%s, line=%d\n", __FILE__, __FUNCTION__, __LINE__); }
15
16#define perr(fmt, args...) { do { fprintf(stderr, "[%s] error: " fmt, PROGNAME, ##args); } while (0); fprintf(stderr, ", err=%m, file=%s, func=%s, line=%d\n", __FILE__, __FUNCTION__, __LINE__); }
17
18#endif
Note: See TracBrowser for help on using the repository browser.