接入xlog
参考链接:
iOS接入指南
1.github clone
2.安装 cmake
3.python build_ios.py
4.选择2 xlog的
5.生成framework 路径 mars-master/mars/cmake_build/iOS/Darwin.out/mars.framework
6.拉入工程 main.m AppDelegate.m 后缀改成mm
7.代码参考mars-master/samples/iOS/iOSDemoXlog/iOSDemo
生成xlog
找到mars-master/samples/iOS/iOSDemoXlog/iOSDemo的LogHelper
拉入工程 pch引入#import "LogHelper.h"
pch 宏定义
#define __FILENAME__ (strrchr(__FILE__,'/')+1)
#ifdef DEBUG
#define NSLog(format, ...) LogInternal(kLevelDebug, "ttyyc", __FILENAME__, __LINE__, __FUNCTION__, @"Debug:", format, ##__VA_ARGS__)
#else
#warning 当前为 Release 模式
#define NSLog(format, ...) LogInternal(kLevelInfo, "ttyyc", __FILENAME__, __LINE__, __FUNCTION__, @"Info:", format, ##__VA_ARGS__)
#endif
解密xlog
去到目录
cd download/mars-master/mars/log/crypt
运行
python decode_mars_crypt_log_file
如果报错
ImportError: No module named pyelliptic
运行
pip2 install pyelliptic==1.5.7
报错
Consider using the --user
option or check the permissions.
报错
ImportError: No module named zstandard
pip2 install pyelliptic==1.5.7
pip2 install zstd --user
pip2 install zstandard --user
Demo地址:https://github.com/zhujieshan/JSLogDemo
运行之后双击home踢掉APP,然后进到沙盒拿到压缩好的xlog,拿出来解密
python decode_mars_crypt_log_file.py /Users/xxx/Documents/download/mars-master/mars/log/crypt/TEST_LOG__20210421.xlog
解密
log内容
网友评论