Hi all, I'm trying to wrap NSLog function just to add some info every time I log something, but I have a problem.
The NSLog declaration is
void NSLog(NSString *format, ...) __attribute__((format(__NSString__,1,2)))
this allow to have multiple parameters in call as
NSLog(@"first %@ second %@ third %d,string,string,number);
My declaration function is similar
void LogUtil(id sender, int level, NSString *str, ...) __attribute__((format(__NSString__,3,4)))
and the implementation is just
void LogUtil(id sender, int level, NSString *str, ...){
if(level>=LEVEL){
NSLog(@"<%@> %@",sender,str);
}
}
So I'm able to call it right as
NSLog(self, 1, @"first %@ second %@ third %d,string,string,number);
but in this case the attributes won't evaluated.
So, I think I have to do something in my implementation to formatting str with paramters but how??
thaks in advance