ios - Using Objective C API in Macro to Log in static lib -
i this, having error on first 'if'.
#if ([[[nsprocessinfo processinfo] arguments] containsobject:@"-com.myproj.mylibdebug"]) #define dlog(fmt, ...) nslog((@"%s [line %d] " fmt), __pretty_function__, __line__, ##__va_args__) #else #define dlog(...) /* */ #endif
how can use using macro? possible write such expression in objective c?
or doing more advanced, such next value of -com.myproj.mylibdebug
in arguments array , set debug log level 4 or 8 depending on value.
the arguments passed build configuration (scheme)
-com.myproj.mylibdebug 4
i go other way around , base define on if() result.
#define dlog(fmt, ...) { if ([[[nsprocessinfo processinfo] arguments] containsobject:@"-com.myproj.mylibdebug"]) {\ ....\ } else {\ }
the #if
macro based, can't use dynamic values
Comments
Post a Comment