-
Notifications
You must be signed in to change notification settings - Fork 0
rbm start logcat
Go to home | documentation | ant tasks
Starts logcat on connected device/emulator and writes all logs to specific file on host. Has ability to specify filter. This task mimics the way adb logcat works and gives almost the same way of configuratbility as the command-line equivalent. So if there is something that is not clear from description of this task you may consult adb logcat --help.
Note that if task fails it does so silently without failing the build. Though message is printed to ant output if this happens.
<rbm-start-logcat file="${out.file}"
id="${logcat.id}"
buffer="${buffer.main}"
format="${output.format}"
binary="${output.binary}"
silent="${silent.all}"
dump="${dump.mode}">
<tag name="test.tag1" level="error" />
<tag name="test.tag2" level="warning" />
<tag name="test.tag2" level="warn" />
</rbm-start-logcat>-
file- required, name of file to store logcat output to. -
id- optional, name of reference that will point to logcat instance. It can be later used to stop the logcat. -
buffer- optional, default: device dependent (usually main). Name of buffer to use. Known buffer names: main, radio, events. The task does not verify the correctness of buffer name, it's simply passed to logcat as argument. -
format- optional, default: device dependent (usually brief). Name of log format output. Known formats: brief, process, tag, thread, raw, time, threadtime, long. The task does not check the correctness of format name, it's simply passed to logcat as argument. -
binary- optional, default: false. Weather log output is in binary format. -
silent- optional, default: false. If set to true, all tags have silent log level by default. If set false, all tags have verbose level by default. -
dump- optional, default: false. If this is set to false, logcat is running until it's explicitely stopped (usingrbm-stop-logcat). If this is set to true, logcat dumps only current logs and exits. Note also that ifdumpis true, this task is synchronous and won't return until all logs are dumped, while in other cases it returns immediately (potentially without a single line written into output file).
<tag name="${tag}" level="${level}" />Used to specify filter for logcat. Can appear multiple time. If no elements are specified, all tags are written to ouput.
-
name- required, name of tag or*for all tags. -
level- required, level name. Only logs from same level or higher for specified tag are going to be written to output. Supported levels: verbose, debug, info, warn (or warning), error, fatal, silent.
Simply start and stop logcat:
<rbm-start-logcat id="logcat" file="${some.dir}/logcat.txt" />
...run some tests here...
<rbm-stop-logcat refid="logcat" />Or if we want to only dump current logs with custom filter:
<rbm-start-logcat file="${project.bin.dir}/logcat.txt"
buffer="main"
format="brief"
silent="false"
dump="true" >
<tag name="test.tag1" level="error" />
<tag name="test.tag2" level="warning" />
<tag name="test.tag3" level="info" />
</rbm-start-logcat>Go to home | documentation | ant tasks