xutils3 的 LogUtil使用

我的环境:

Android Studio 2.33

        xutils3

这些怎么下载,配置我就不详细的解说了, 不清楚的可以加QQ群: 128029265


1. 可以在  MyApplicaion 增加 Tag


public class MyApplication extends Application {


    @Override
    public void onCreate() {
        super.onCreate();
        //对xUtils进行初始化
        x.Ext.init(this);
        //是否是开发、调试模式
        x.Ext.setDebug(BuildConfig.DEBUG);//是否输出debug日志,开启debug会影响性能


        LogUtil.customTagPrefix = "allwhere"; // 方便调试时过滤 adb logcat 输出
    }
}


2. 配置 logcat

xutils3 的 LogUtil使用

设置过滤器

xutils3 的 LogUtil使用

xutils3 的 LogUtil使用


3. 写代码

在 protected void onCreate(Bundle savedInstanceState) 中写如下代码:

LogUtil.e("这是下标为4的输出,上面是当前整个调用栈的情况");


P.S.  如果这都不知道,给点打赏吧


4. 运行的结果

xutils3 的 LogUtil使用


CSDN 是个好地方, 大家都贡献一份力气吧, 我会把自己的一些心得分享给大家!