Frank Fan
Frank Fan

Reputation: 159

adb shell setprop log.tag.SOMETAG VERBOSE, how to get SOMETAG?

When I watch android source code, I found

adb shell setprop log.tag.CAM2PORT_ VERBOSE 

This can output log in logcat. I want to know how to make all log tag output even if it is verbose.

I have tried

adb shell setprop log.tag.* VERBOSE  #It's not work

Thanks for your help

Upvotes: 3

Views: 9566

Answers (2)

Mike Mostovyi
Mike Mostovyi

Reputation: 51

In order to set a global minimum log level there is no need to configure tags individually. Just run

adb shell setprop persist.log.tag V

to enable all logs with any tag. Any supported Android priority can be set, so also DEBUG, INFO and others. The names can be specified in full, but only the first character is relevant. You can find more details here: https://medium.com/@mike_87757/set-android-minimum-log-level-globally-for-all-tags-4b1cbc1dc71f

Upvotes: 5

GilCol
GilCol

Reputation: 391

You must set every tag you want to log. Regex like log.tag.* won't work. Like you said, not optimal if you are using different tags in your app.

You can try to use the local.prop file and define all your tags, probably easier than using adb shell setprop for every tag every time you want to enable logging.

You can also create a local.prop file that with the following in it: 'log.tag.=' and place that in /data/local.prop.

https://developer.android.com/reference/android/util/Log.html#isLoggable(java.lang.String,%20int)

Upvotes: 1

Related Questions