1#!/bin/bash 2 3if [ $# -ne 1 ] 4then 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" 9 exit 1 10fi 11 12# List all log tags 13declare -a tags=( 14 MediaTranscoder MediaTrackTranscoder VideoTrackTranscoder PassthroughTrackTranscoder 15 MediaSampleWriter MediaSampleReader MediaSampleQueue MediaTranscoderTests 16 MediaTrackTranscoderTests VideoTrackTranscoderTests PassthroughTrackTranscoderTests 17 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 28 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 37