接入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 當(dāng)前為 Release 模式
#define NSLog(format, ...) LogInternal(kLevelInfo, "ttyyc", __FILENAME__, __LINE__, __FUNCTION__, @"Info:", format, ##__VA_ARGS__)
#endif
解密xlog
去到目錄
cd download/mars-master/mars/log/crypt
運(yùn)行
python decode_mars_crypt_log_file
如果報(bào)錯(cuò)
ImportError: No module named pyelliptic
運(yùn)行
pip2 install pyelliptic==1.5.7
報(bào)錯(cuò)
Consider using the --user
option or check the permissions.
報(bào)錯(cuò)
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
運(yùn)行之后雙擊home踢掉APP,然后進(jìn)到沙盒拿到壓縮好的xlog,拿出來解密
python decode_mars_crypt_log_file.py /Users/xxx/Documents/download/mars-master/mars/log/crypt/TEST_LOG__20210421.xlog