Authored by gaoqiang xu

1. 使用 __PRETTY_FUNCTION__ 代替 __FUNCTION__

2. Demo中增加注释
... ... @@ -19,8 +19,23 @@
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
/*
* 启动日志系统
*/
[DDLog startWithLogLevel:DDLogLevelAll];
/*
* 默认配置为10个文件,24小时日志循环间隔时间
* 如要修改,参考下面的代码
*/
[DDLog sharedInstance].fileLogger.rollingFrequency = 60 * 60 * 12; // 12小时内使用一个1个log文件
[DDLog sharedInstance].fileLogger.logFileManager.maximumNumberOfLogFiles = 20; // 最大20个日志文件
/*
* 打印日志,使用时,比DDLog多了一个tag参数
*/
YOHOLogInfo(@"gaoqiang", @"info hahaha %@", @"xixixixix");
YOHOLogError(@"", @"test");
... ...
... ... @@ -17,27 +17,27 @@
*/
#define YOHOLogError(tag, frmt, ...) \
[DDLog logWithFunctionName:__FUNCTION__ \
[DDLog logWithFunctionName:__PRETTY_FUNCTION__ \
line:__LINE__ \
loggerUser:tag \
errorMessage:frmt, ## __VA_ARGS__]
#define YOHOLogWarn(tag, frmt, ...) \
[DDLog logWithFunctionName:__FUNCTION__ \
[DDLog logWithFunctionName:__PRETTY_FUNCTION__ \
line:__LINE__ \
loggerUser:tag \
loggerUser:tag \
warnMessage:frmt, ## __VA_ARGS__]
#define YOHOLogDebug(tag, frmt, ...) \
[DDLog logWithFunctionName:__FUNCTION__ \
[DDLog logWithFunctionName:__PRETTY_FUNCTION__ \
line:__LINE__ \
loggerUser:tag \
loggerUser:tag \
debugMessage:frmt, ## __VA_ARGS__]
#define YOHOLogInfo(tag, frmt, ...) \
[DDLog logWithFunctionName:__FUNCTION__ \
[DDLog logWithFunctionName:__PRETTY_FUNCTION__ \
line:__LINE__ \
loggerUser:tag \
loggerUser:tag \
infoMessage:frmt, ## __VA_ARGS__]
#endif /* CocoaLumberjack_YOHO_h */
... ...