123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #import <Foundation/Foundation.h>
- #import "OSSCocoaLumberjack.h"
- static const OSSDDLogLevel ossLogLevel = OSSDDLogLevelAll;
- #define XCODE_COLORS_ESCAPE @"\033["
- #define XCODE_COLORS_RESET_FG XCODE_COLORS_ESCAPE @"fg;"
- #define XCODE_COLORS_RESET_BG XCODE_COLORS_ESCAPE @"bg;"
- #define XCODE_COLORS_RESET XCODE_COLORS_ESCAPE @";"
- #define OSSLogVerbose(frmt, ...)\
- if ([OSSLog isLogEnable]) {\
- OSSDDLogVerbose(@"[Verbose]: %@", [NSString stringWithFormat:(frmt), ##__VA_ARGS__]);\
- }
- #define OSSLogDebug(frmt, ...)\
- if ([OSSLog isLogEnable]) {\
- OSSDDLogDebug(@"[Debug]: %@", [NSString stringWithFormat:(frmt), ##__VA_ARGS__]);\
- }
- #define OSSLogDebugNoFile(frmt, ...)\
- if ([OSSLog isLogEnable]) {\
- NSLog(@"[Debug]: %@", [NSString stringWithFormat:(frmt), ##__VA_ARGS__]);\
- }
- #define OSSLogError(frmt, ...)\
- if ([OSSLog isLogEnable]) {\
- OSSDDLogError(@"[Error]: %@", [NSString stringWithFormat:(frmt), ##__VA_ARGS__]);\
- }
- #define OSSLogWarn(frmt, ...)\
- if ([OSSLog isLogEnable]) {\
- OSSDDLogWarn(@"[Warning]: %@", [NSString stringWithFormat:(frmt), ##__VA_ARGS__]);\
- }
- static BOOL isEnable;
- @interface OSSLog : NSObject
- + (void)enableLog;
- + (void)disableLog;
- + (BOOL)isLogEnable;
- @end
|