一个基于iOS的日志系统,包含许多优秀的功能,基于Xcodecolors和KZLinkedConsole。
添加日志审查并在App中发送日志文件电子邮件
添加Mac客户端以帮助您在没有数据线的情况下进行调试。(项目文件中包含名为CATLogServer.zip的mac客户端)
为日志添加自定义背景色
下面是中文内容
此库需要一个iOS 6.0或更高版本的部署目标。
在您的应用程序启动时,只需一行代码即可配置CATLog。然后将您的NSLog语句替换为CLog[X]语句,就这么简单。
pod 'CATLog'
或者您可以直接将CATLog.h
& CATLog.m
源代码文件添加到您的项目中。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//Set ExceptionHandler
NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler);
//Init log
[CATLog initWithNumberOfDaysToDelete:3];
}
void uncaughtExceptionHandler(NSException *exception){
[CATLog logCrash:exception];
}
[CATLog setLogLevel:CATLevelE];
[CATLog setR:200 G:200 B:200 forLevel:CATLevelE];
#define YouLogI(fmt, ...) [CATLog logI:[NSString stringWithFormat:@"[%@:%d] %s %@",[NSString stringWithFormat:@"%s",__FILE__].lastPathComponent,__LINE__,__func__,fmt],##__VA_ARGS__,@""];
YouLogI(@"ReDefine Log by yourself");
[CATLog shwoAllLogFile];
[CATLog showTodayLogFile];
1. 修复 numberOfDaysToDelete 错误
2. 添加日志查看功能和将日志文件通过电子邮件发送到应用
1. 修复 pod 错误
2. 添加 Mac 客户端
添加项目
一个基于 Xcodecolors 和 KZLinkedConsole,具有许多优良特性的iOS开源日志工具。
iOS6 或更高版本
只需要添加几行代码即可配置完成。然后将 NSLog 替换为 CLog[X]。
pod 'CATLog'
直接将 CATLog.h
和 CATLog.m
拖拽到项目中。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//Set ExceptionHandler
NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler);
//Init log
[CATLog initWithNumberOfDaysToDelete:3];
}
void uncaughtExceptionHandler(NSException *exception){
[CATLog logCrash:exception];
}
[CATLog setLogLevel:CATLevelE];
[CATLog setNumberOfDaysToDelete:3];
[CATLog setR:200 G:200 B:200 forLevel:CATLevelE];
#define YouLogI(fmt, ...) [CATLog logI:[NSString stringWithFormat:@"[%@:%d] %s %@",[NSString stringWithFormat:@"%s",__FILE__].lastPathComponent,__LINE__,__func__,fmt],##__VA_ARGS__,@""];
YouLogI(@"ReDefine Log by yourself");
[CATLog shwoAllLogFile];
[CATLog showTodayLogFile];
1.修复了设置删除日志文件天数的bug
2.增加了日志的预览和邮件发送日志功能
1.修复了pod问题
2.增加了mac客户端
添加了基本工程