LogcatView
日志记录抓取
没有数据线的时候,就用这个输出日志吧
- 使用简单,一行代码搞定
- 点击链接可以用浏览器打开
- 可抓取大部分Android Studio中Logcat打印的内容
- 可以搜索内容
- 可按tag过滤
- 可根据日志等级筛选(提供隐藏方法)
- A 所有内容
- O System.out 输出的内容
- W 警告级别的内容
- E 错误级别的内容
集成
Step 1. Add the JitPack repository to your build file
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://www.jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
compile 'com.github.huangdali:LogcatView:v1.1.2'
}
使用
new LogcatDialog(this).show();
关于样式
【如果你的activity继承至AppCompatActivity,请跳过此步骤】如果你的Activity不是继承至AppCompatActivity,那么样式可能会很丑,可以通过下面的设置:
1、在style.xml中定义
<style name="Translucent_NoTitle" parent="android:style/Theme.Dialog">
<item name="android:background">#00000000</item> <!-- 设置自定义布局的背景透明 -->
<item name="android:windowBackground">@android:color/transparent</item> <!-- 设置window背景透明,也就是去边框 -->
</style>
2、设置主题
LogcatDialog logcatDialog = new LogcatDialog(mContext,R.style.Translucent_NoTitle);
logcatDialog.show();