For an app I'm developing, I want to ease troubleshooting, both while it's in development and when it's released. I want to be able to retrieve calls to Log
for when the app is being run without the phone connected in USB debugging, so it can be retrieved and sent to me. For example, when the app crashes, or when Log.e(...)
is called, the log history (Calls to Log.i()
, Log.w()
) can be sent to a server, or the user can send it to me manually.
How can/should this be done?
Also, should the technique vary depending on if the app is in development vs release? (I know from the android Log
docs that Log.v(...)
should not be compiled into release versions - is there a better way than commenting out all those calls?)
It might make sense to extend Log
or roll my own, but the devil is in the details.