19 #import <Foundation/Foundation.h>
87 #if defined(DEBUG) || defined(NI_DEBUG)
95 #import <TargetConditionals.h>
97 #if defined __cplusplus
103 #if defined __cplusplus
107 #if TARGET_IPHONE_SIMULATOR
110 #define NIDASSERT(xx) { if (!(xx)) { NIDPRINT(@"NIDASSERT failed: %s", #xx); \
111 if (NIDebugAssertionsShouldBreak && NIIsInDebugger()) { __asm__("int $3\n" : : ); } } \
114 #define NIDASSERT(xx) { if (!(xx)) { NIDPRINT(@"NIDASSERT failed: %s", #xx); \
115 if (NIDebugAssertionsShouldBreak && NIIsInDebugger()) { raise(SIGTRAP); } } \
117 #endif // #if TARGET_IPHONE_SIMULATOR
120 #define NIDASSERT(xx) ((void)0)
121 #endif // #if defined(DEBUG) || defined(NI_DEBUG)
124 #define NILOGLEVEL_INFO 5
125 #define NILOGLEVEL_WARNING 3
126 #define NILOGLEVEL_ERROR 1
153 #if defined(DEBUG) || defined(NI_DEBUG)
154 #define NIDPRINT(xx, ...) NSLog(@"%s(%d): " xx, __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
156 #define NIDPRINT(xx, ...) ((void)0)
157 #endif // #if defined(DEBUG) || defined(NI_DEBUG)
162 #define NIDPRINTMETHODNAME() NIDPRINT(@"%s", __PRETTY_FUNCTION__)
164 #if defined(DEBUG) || defined(NI_DEBUG)
171 #define NIDCONDITIONLOG(condition, xx, ...) { if ((condition)) { NIDPRINT(xx, ##__VA_ARGS__); } \
174 #define NIDCONDITIONLOG(condition, xx, ...) ((void)0)
175 #endif // #if defined(DEBUG) || defined(NI_DEBUG)
181 #define NIDERROR(xx, ...) NIDCONDITIONLOG((NILOGLEVEL_ERROR <= NIMaxLogLevel), xx, ##__VA_ARGS__)
186 #define NIDWARNING(xx, ...) NIDCONDITIONLOG((NILOGLEVEL_WARNING <= NIMaxLogLevel), \
192 #define NIDINFO(xx, ...) NIDCONDITIONLOG((NILOGLEVEL_INFO <= NIMaxLogLevel), xx, ##__VA_ARGS__)