diff -r e55a17cdabd2 -r 823e7e74088e Logging.h --- a/Logging.h Thu Mar 20 09:05:58 2008 -0700 +++ b/Logging.h Sat May 17 13:14:48 2008 -0700 @@ -12,13 +12,23 @@ NSString* LOC( NSString *key ); // Localized string lookup -#define Log(FMT,ARGS...) do{if(__builtin_expect(_gShouldLog,0)) _Log(FMT,##ARGS);}while(0) +#ifdef __cplusplus + #define IN_SEGMENT(SEG) +#else + #define IN_SEGMENT(SEG) auto __attribute__ ((section ("__TEXT, "#SEG))) __attribute__ ((noinline)) void _outofband_(void);\ + _outofband_();\ + void _outofband_(void) +#endif + +#define Log(FMT,ARGS...) do{if(__builtin_expect(_gShouldLog,0)) {\ + IN_SEGMENT(Logging){_Log(FMT,##ARGS);}\ + } }while(0) +#define LogTo(DOMAIN,FMT,ARGS...) do{if(__builtin_expect(_gShouldLog,0)) {\ + IN_SEGMENT(Logging) {_LogTo(@""#DOMAIN,FMT,##ARGS);}\ + } }while(0) #define Warn Warn void AlwaysLog( NSString *msg, ... ) __attribute__((format(__NSString__, 1, 2))); - -#define LogTo(DOMAIN,FMT,ARGS...) do{if(__builtin_expect(_gShouldLog,0)) _LogTo(@""#DOMAIN,FMT,##ARGS);}while(0) - BOOL _WillLogTo( NSString *domain ); BOOL EnableLog( BOOL enable ); #define EnableLogTo( DOMAIN, VALUE ) _EnableLogTo(@""#DOMAIN, VALUE)