Changeset 22092 for branches/swt/include/dbglog.h
- Timestamp:
- Mar 31, 2015, 5:56:39 PM (11 years ago)
- File:
-
- 1 edited
-
branches/swt/include/dbglog.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/swt/include/dbglog.h
r22041 r22092 14 14 #ifdef __cplusplus 15 15 extern "C" { 16 #endif 17 18 // To enable global console logging, use 'kmk DBG_CON=' _or_ set 'DBG_CON=' 19 // in LocalConfig.kmk _or_ set DBG_CON to some value in the environment. 20 // Per source console logging can be enabled by defining DBG_CON _before_ 21 // the inclusion of the <misc.h> header. 22 #ifdef DBG_CON 23 #define PFXFMT "**__con_debug(%d)** " 24 #define __con_debug(lvl, fmt, ...)\ 25 switch (lvl) {\ 26 case 0:\ 27 break;\ 28 case 2:\ 29 printf(PFXFMT, lvl);\ 30 printf(fmt, __VA_ARGS__);\ 31 break;\ 32 case 3:\ 33 printf(PFXFMT"FUNCTION:%s ", lvl, __FUNCTION__);\ 34 printf(fmt, __VA_ARGS__);\ 35 break;\ 36 case 4:\ 37 printf(PFXFMT"FILE:%s FUNCTION:%s ", lvl, __FILE__, __FUNCTION__);\ 38 printf(fmt, __VA_ARGS__);\ 39 break;\ 40 case 5:\ 41 printf(PFXFMT, lvl);\ 42 printf(fmt, __VA_ARGS__);\ 43 break;\ 44 default:\ 45 printf(fmt, __VA_ARGS__);\ 46 break;\ 47 }\ 48 fflush(stdout) 49 #else 50 #define __con_debug(lvl, fmt, ...) 16 51 #endif 17 52
Note:
See TracChangeset
for help on using the changeset viewer.
