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

如何过滤掉某些tag,不写入到文件? #128

Open
hanxiaofeng opened this issue Apr 21, 2022 · 2 comments
Open

如何过滤掉某些tag,不写入到文件? #128

hanxiaofeng opened this issue Apr 21, 2022 · 2 comments

Comments

@hanxiaofeng
Copy link

有些无用的tag日志不想写入文件,如何过滤?

@elvishew
Copy link
Owner

如果不想写入文件的同时,接受不同时写到 Logcat,在初始化时指定 BlacklistTagsFilterInterceptor 过滤掉指定 tag 即可。
如果只是不想写入文件,但希望能打印到 Logcat,可自己组装一个 Printer,里面包装一个 AndroidPrinter 和一个 FilePrinter,并在调用 FilePrinter.print 前对 tag 进行过滤。

@scsfwgy
Copy link

scsfwgy commented Sep 6, 2022

也有类似的需求,比如我想把不同等级的日志写入到不同的文件中,比如 debug.log error.log这种场景。这样调整一下代码?上层应用如果不需要写入,直接返回null,避免无效写入。

image

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

3 participants