[Tech] Custom log lines (aliasing NSLog) #iOS #Objective-C

// MFLog
#define MFDEBUG
#ifdef MFDEBUG
#define MFLog(x,...) NSLog(@"%s - %@", __FUNCTION__, [NSString stringWithFormat:(x), ##__VA_ARGS__])
#else
#define MFLog(x,...)
#endif [...]
MFLog(@"Hello GoodBarbers :) %d", i);
[...] 
Our development team always prefixes the class names and other methods with "GB" (for GoodBarber of course). But in this case, I used my custom log method far before the start of the project and had prefixed it with my initials. And it stayed like that ... :)
// MFImportantLog
// MEMLog

Here is the definition of the MEMLog alias, to get a pretty output:
#define MEMLog(x, ...) NSLog(@"-[%@ %@] - %@", [[[[NSString stringWithFormat:@"%@", self] componentsSeparatedByString:@":"] objectAtIndex:0] stringByReplacingOccurrencesOfString:@"<" withString:@""], [[[[NSString stringWithFormat:@"%s", __FUNCTION__] componentsSeparatedByString:@" "] objectAtIndex:1] stringByReplacingOccurrencesOfString:@"]" withString:@""], [NSString stringWithFormat:(x), ##__VA_ARGS__])
Design

