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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -