简体   繁体   English

如何仅使用开发人员的日志过滤日志?

[英]How to filter logs only with developer's logs?

When I am starting application I see a lot of different logs. 当我启动应用程序时,我看到很多不同的日志。 I know that I can use tag in my class, but I don't want filter all logs by tag from one class. 我知道我可以在班级中使用标签,但我不想按一个班级的标签过滤所有日志。 How can I filter all logs of application to all logs from developer? 如何过滤应用程序的所有日志到开发人员的所有日志? I mean logs, which was created by developer in all classes using Log class. 我的意思是日志,它是由开发人员在所有类中使用Log类创建的。

Create the unique application prefix for all your tags: 为所有标签创建唯一的应用程序前缀:

public static final String APPLICATION_TAG = "MyApplicationTags; ";

And use it with all tags: 并将其与所有标签一起使用:

public static final String TAG = APPLICATION_TAG + "MainActivity";

So you can filter all logs by your application prefix. 因此,您可以按应用程序前缀过滤所有日志。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM