How do you usually Tag log entries? (android)

后端 未结 13 1561
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-22 21:54

I assume most of you are aware of android.util.Log All logging methods accept \'String tag\' as a first argument.

And my question is How do you usually tag y

13条回答
  •  失恋的感觉
    2020-12-22 22:14

    I usually use the method name as the tag but from Thread

    String TAG = Thread.currentThread().getStackTrace()[1].getMethodName();
    

    This avoids the new Exception.

提交回复
热议问题