1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| #define YostarDebugLogLevel(level, fmt, ...) \ [YostarDebugLog logLevel:level file:__FILE__ function:__PRETTY_FUNCTION__ line:__LINE__ format:(fmt), ##__VA_ARGS__]
#define YostarDebugLog(fmt, ...) \ YostarDebugLogLevel(YostarDebugLogLevelInfo, (fmt), ##__VA_ARGS__)
#define YostarDebugWarningLog(fmt, ...) \ YostarDebugLogLevel(YostarDebugLogLevelWarning, (fmt), ##__VA_ARGS__)
#define YostarDebugErrorLog(fmt, ...) \ YostarDebugLogLevel(YostarDebugLogLevelError, (fmt), ##__VA_ARGS__)
typedef NS_ENUM(NSUInteger, YostarDebugLogLevel) { YostarDebugLogLevelInfo = 1, YostarDebugLogLevelWarning, YostarDebugLogLevelError };
@interface YostarDebugLog : NSObject
+ (BOOL)isDebugLogEnabled;
+ (void)enableDebugLog:(BOOL)enableLog;
+ (void)logLevel:(NSInteger)level file:(const char *)file function:(const char *)function line:(NSUInteger)line format:(NSString *)format, ...;
|