blob: b0f0a2e758137523e11f97477a6f62466ac6dbef [file] [log] [blame]
Linus Nilssonaf4a3212020-12-15 08:18:25 -08001#!/bin/bash
2
3if [ $# -ne 1 ]
4then
Linus Nilsson52df71c2021-03-08 13:01:11 -08005 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 Nilssonaf4a3212020-12-15 08:18:25 -08009 exit 1
10fi
11
Linus Nilssonaf4a3212020-12-15 08:18:25 -080012# List all log tags
13declare -a tags=(
14 MediaTranscoder MediaTrackTranscoder VideoTrackTranscoder PassthroughTrackTranscoder
15 MediaSampleWriter MediaSampleReader MediaSampleQueue MediaTranscoderTests
16 MediaTrackTranscoderTests VideoTrackTranscoderTests PassthroughTrackTranscoderTests
Linus Nilsson52df71c2021-03-08 13:01:11 -080017 MediaSampleWriterTests MediaSampleReaderNDKTests MediaSampleQueueTests HdrTranscodeTests)
18
19if [ "$1" == "-l" ]; then
20 echo "Transcoder log tags:"
21 for tag in "${tags[@]}"; do echo -n "$tag "; done
22 echo
23 exit 0
24fi
25
26level=$1
27echo Setting transcoder log level to $level
Linus Nilssonaf4a3212020-12-15 08:18:25 -080028
29# Set log level for all tags
30for tag in "${tags[@]}"
31do
32 adb shell setprop log.tag.${tag} $level
33done
34
35# Pick up new settings
36adb shell stop && adb shell start