(Suppose you are using the log framework from the package android.util.Log.)
You can start the "logcat" process with specific parameters from your process. It resets the last 16k logs (16k is the default for my phone, it may be different on other phones).
Here is an example command line that unloads all logs: logcat -d -f /mnt/sdcard/log-dump.txt
Another example that throws errors from all applications:logcat -d -f /mnt/sdcard/err-dump.txt *:e
You need to start the process from your application programmatically. And then handle log-dump.txt/ the err-dump.txtway you want.
, , 16k. logcat -d. , logcat , . , logcat.
logcat adb logcat <params> .