Mercurial > rcctl_linux
comparison debug.h @ 2:b16b82dbfe87
massive cleanup
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Wed, 05 Jan 2011 21:41:39 +0900 |
parents | |
children | 37e662c427a1 |
comparison
equal
deleted
inserted
replaced
1:05cc06e88a57 | 2:b16b82dbfe87 |
---|---|
1 #ifndef __RCCTL_DEBUG_H__ | |
2 #define __RCCTL_DEBUG_H__ | |
3 | |
4 extern int debug; | |
5 | |
6 /* print debug message if specified level is greater enough */ | |
7 #define debug(level, fmt, ...) \ | |
8 do { \ | |
9 if(debug >= level) { \ | |
10 fprintf(stderr, "%s: %s():%4d: " fmt, __FILE__, __FUNCTION__, (int) __LINE__, ## __VA_ARGS__); \ | |
11 } \ | |
12 } while(0); | |
13 | |
14 #endif |