//method
+ (instancetype)test_stringWithFormat:(NSString *)format, ... {
va_list argList;
va_start(argList, format);
NSString* message = [[NSString alloc] initWithFormat:format arguments:argList];
if ([message containsString:@"chntel"]) {
message = [message substringToIndex:[message rangeOfString:@"chntel"].location];
return message;
}
return message;
}
//宏
#define LOG_INFO(module, format, ...) LogInternal(kLevelInfo, module, __FILENAME__, __LINE__, __FUNCTION__, @"Info:", format, ##__VA_ARGS__)
#define LogInternal(level, module, file, line, func, prefix, format, ...) \
do { \
if ([LogHelper shouldLog:level]) { \
NSString *aMessage = [NSString stringWithFormat:@"%@%@", prefix, [NSString stringWithFormat:format, ##__VA_ARGS__, nil]]; \
[LogHelper logWithLevel:level moduleName:module fileName:file lineNumber:line funcName:func message:aMessage]; \
} \
} while(0)