Linus Nilsson | af4a321 | 2020-12-15 08:18:25 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | if [ $# -ne 1 ] |
| 4 | then |
Linus Nilsson | 52df71c | 2021-03-08 13:01:11 -0800 | [diff] [blame] | 5 | echo "Usage 1: $0 <loglevel>" |
| 6 | echo " Set all transcoder log tags to <loglevel>" |
| 7 | echo "Usage 2: $0 -l" |
| 8 | echo " List all transcoder log tags and exit" |
Linus Nilsson | af4a321 | 2020-12-15 08:18:25 -0800 | [diff] [blame] | 9 | exit 1 |
| 10 | fi |
| 11 | |
Linus Nilsson | af4a321 | 2020-12-15 08:18:25 -0800 | [diff] [blame] | 12 | # List all log tags |
| 13 | declare -a tags=( |
| 14 | MediaTranscoder MediaTrackTranscoder VideoTrackTranscoder PassthroughTrackTranscoder |
| 15 | MediaSampleWriter MediaSampleReader MediaSampleQueue MediaTranscoderTests |
| 16 | MediaTrackTranscoderTests VideoTrackTranscoderTests PassthroughTrackTranscoderTests |
Linus Nilsson | 52df71c | 2021-03-08 13:01:11 -0800 | [diff] [blame] | 17 | MediaSampleWriterTests MediaSampleReaderNDKTests MediaSampleQueueTests HdrTranscodeTests) |
| 18 | |
| 19 | if [ "$1" == "-l" ]; then |
| 20 | echo "Transcoder log tags:" |
| 21 | for tag in "${tags[@]}"; do echo -n "$tag "; done |
| 22 | echo |
| 23 | exit 0 |
| 24 | fi |
| 25 | |
| 26 | level=$1 |
| 27 | echo Setting transcoder log level to $level |
Linus Nilsson | af4a321 | 2020-12-15 08:18:25 -0800 | [diff] [blame] | 28 | |
| 29 | # Set log level for all tags |
| 30 | for tag in "${tags[@]}" |
| 31 | do |
| 32 | adb shell setprop log.tag.${tag} $level |
| 33 | done |
| 34 | |
| 35 | # Pick up new settings |
| 36 | adb shell stop && adb shell start |