Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

多实例写入文件问题 #5

Open
chenchongyu opened this issue Nov 19, 2021 · 1 comment
Open

多实例写入文件问题 #5

chenchongyu opened this issue Nov 19, 2021 · 1 comment

Comments

@chenchongyu
Copy link

chenchongyu commented Nov 19, 2021

RT.
假如我创建了3个Flog实例,Flog.makeFlog;最终写日志的地方要怎么写呢?
是不是不能用Log.d()的方式来写了,只能通过flog.logD的方式?

另外,通过此组件打印日志后,不能同时在控制台显示?

@lixiaoyu0123
Copy link

lixiaoyu0123 commented Dec 27, 2021

在创建实例的时候,需要传存储路径,Flog.makeFlog的第一个参数就是路径,不同实例存储路径需要设置不同的路径,如果是3个实例,则3个存储路径不相同就可以的。如果想用Log.d(),只需要上层封装一下,可以参考DataTransHub/build/Android/datatranshub/src/main/java/com/iget/flog/Log.java,这个文件。
如果想同时在控制台显示,也同样是上层封装一下,打印数据后可以再调用一下控制台的打印。可以参考上面文件的实现。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants