#define LogMsg(msg) ((DebugMode)?NSLog(@"<%@:%@:%d:%@>", NSStringFromClass([self class]), NSStringFromSelector(_cmd), __LINE__,msg):NO)
With this macro I can print out:
LogMsg(@"Test");
Or
NSArray *testArray = @[@"one",@"two"];
LogMsg(testArray);
How can I do the same with a macro replacement that will also take two arguments like NSLog and still be able to print the array in the form I'm doing with the above? example:
NSLog (@"test: %@",test);
- I'd prefer not using a 3rd party Class for that and solve the above with a macro.
So close! Your macro works with the following invocations:
The compiler will automatically concatenate:
to: