Comments (10)
这块我们再考虑下吧
from logan.
主要是很多都在C层,没专门传递log,debug模式下的logcat是有一些
from logan.
可以考虑先在 JAVA 层增加,后续看是否需要迭代到 C 层
现在打了日志,但是只能导出日志才可以查看(或者打两份日志),开发调试时颇为不便
from logan.
你是说要看写入Logan的日志?
from logan.
是的,希望调试时,能在 logocat 直观看到明文的日志内容,在 Logan 设置 debug 模式时,发现只是输出一些 Logan 的操作日志,并非自己写入的内容。 如果要查看还需要将该日志导出或者其他途径去读取~ 总觉得在测试过程中并不是很便利(这个时候不禁想到 OkHttp 的 Interceptor ,增加拦截器后,在调试时的输出花样就多了)。
目前 Logan 加密和数据格式化都在 C 层,是否可以考虑通过拆包来解除耦合?这样就可以通过拦截器
的概念来对数据定制化(加密、格式)
from logan.
明文看Logan日志内容,和Android自带的log没区别了呀,你在写入之前不就可以看到么。
Logan加密和数据格式化都在C层,是因为提升性能同时保证数据的隐私性,不被其他人破解,所以Java层只有预处理等操作,和日志真正的内容无关
from logan.
Logan不是用来代替Log打日志用的,而是用来存储关键日志,进行个案分析的
from logan.
通过拦截器对数据处理,实际操作一样可以放在 C 层,这并不影响拆包。
在调试过程中,关键日志同样需要在 Logocat 中可以查看,便于调试,于是就不得不多编写一份 Log 输出的代码。
if (BuildConfig.DEBUG) {
Log.e(xxx);
}
Logan.w(xxx);
虽然也可以通过包装一次 Logan 来处理这个问题
public class LoganDelegate{
public static void w(xxxx){
if (BuildConfig.DEBUG) {
Log.d(xxxx);
}
Logan.w(xxxx);
}
}
不过这个 issue 主要目的并不是说输出 logocat 这个功能,而是建议拦截器
的功能。这样可以给 Logan 带来更多的可能性,比如 数据格式( json、protobuf 或者其他),加密规则自定义(比如我想多加几次盐、或者把秘钥都写到 C 层、或者根据日志级别选择加密不加密、又或者想换其他的加密算法),数据范本自定义(可能并不满足于 WriteAction 的内容格式,也许我想更多的收集一些其他固定数据)
当有了拦截器后,除了实际写入的拦截器,其他的以分包的形式发布供于选择
Logan.w -> DataEncapsulationInterceptor -> EncryptInterceptor -> WriteInterceptor
from logan.
我明白你的意思,不过在Logan中拦截器能做的确实有限,主要功能都在C,如果在java层只是定义拦截器配置传到C再去处理,就会徒增复杂度了。就比如你说要更改加密规则的前提是,C层要有实现才可以。
from logan.
如果不放弃性能就会提升复杂度,个人觉得这块性能的影响应该可以忽略?
from logan.
Related Issues (20)
- 原生端与Web端加密格式化流程不一致原因求解答
- Android端上传到服务器的Logan日志文件是空的 HOT 1
- 5007
- 点击日志祥情后才解析日志文件?
- 重复上传当天日志,服务端报错 HOT 1
- 保存日志出现崩溃 HOT 2
- 日志一直上传不成功Unexpected end of ZLIB input stream HOT 1
- Android在上傳大的日誌時,會timeout HOT 5
- iOS build warning问题 HOT 6
- Cannot find module 'react-dev-utils/WatchMissingNodeModulesPlugin' HOT 2
- docker-compose up error
- iOS 日志解析会出现日志解析报错,无法展示的问题,decompress error: Unexpected end of ZLIB input stream tryGetEncryptContent error: null HOT 1
- macOS上编译Logan/Example/Logan-Android报错 HOT 5
- 运行LoganSite错误 HOT 1
- 鸿蒙SDK适配 HOT 4
- 什么时候开源适配小程序? HOT 2
- Android 端问题 HOT 1
- Logan android SDK安全检测漏洞问题
- 如何去定制Logan HOT 10
- log-web日志7m限制调整,想要支持更大的存储 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from logan.