I'm looking for a way to save all the logcat output (Filter by tag) in phone memory/sd card. So even if someone who is playing with app, will come to me and say it crashes, or it doesn't work as intended, i could look into logs. I`m using RemoteLogs at the moment, but they not handle standard logcat output.
I think this is not directly possible. What you could do it to override the standard Log.x() methods like this
class MyLog {
boolean sdLog = false;
public void d(String arg1, String arg2) {
if (sdLog) {
someLogFile.append(arg1).append(":").append(arg2);
}
else {
Log.d(arg1,arg2);
}
}
}
and then in your code replace all calls to Log.d() with calls to MyLog.d(). The user can then e.g. in preferences select to log to the sd card or use the standard mechanism.
Generally logging everything to the SD card was not chosen (afair) by Android, as this would mean huge amounts of writes to the card, which would reduce its lifetime.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With