Does Log.isLoggable returns wrong values?

前端 未结 4 1122
一向
一向 2020-12-20 12:06

When I was writing a log wrapper for my android application I noticed a strange behavior of androids Log.isLoggable method. Executing following code:

final S         


        
4条回答
  •  不知归路
    2020-12-20 12:57

    All log levels are written to logcat regardless of what the current log level is. The isLogabble() method can be used as an optimization for your apps to prevent sending unneeded log statements to logcat. You can also use the adb logcat command to filter a subset of the logging levels even if the logging is set to verbose (see https://developer.android.com/studio/debug/am-logcat.html).

提交回复
热议问题