如何打印日志?
问题描述:
如何打印日志
如何打开debug模式?
怎么看log?
统计log怎么看?
解决方案:
统计组件化sdk打印日志接口转移到common的组件中,初始化接口如下:
#import <UMCommon/UMCommon.h>
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//开发者需要显式的调用此函数,日志系统才能工作
[UMCommonLogManager setUpUMCommonLogManager];
[UMConfigure setLogEnabled:YES];//设置打开日志
[UMConfigure initWithAppkey:@"Your appkey" channel:@"App Store"];
}
⚠️注意:
日志库UMCommonLog.framework需要明确初始化才能被各个业务组件使用;
UMCommonLog.bundle为资源文件,必须加入到工程中,否则日志显示的内容会不正确。