Apps-android-commons: Allowing users to send logs to us

Created on 13 Jun 2017  Â·  16Comments  Â·  Source: commons-app/apps-android-commons

Currently, if anyone is having a non-crash issue (like not getting any Nearby results), the best way we can help them is for them to send us logs. Unfortunately, the process of sending non-crash logs is quite convoluted and inconvenient for the user - they have to either install a 3rd party app, or get Android Studio running on their computer, etc.

I wonder if there would be a way to have a function in the app that lets a user send us the last few pages of logs tagged with our app name. So for instance if someone is having issues with Nearby, they can select that, insert a comment like how they do with crash reports, and have it sent to us.

I don't recall seeing this in any other apps, though, so I'm not sure if this is possible or how other apps get logs from users?

enhancement

All 16 comments

Oh, wow. I'm trying to write a walkthrough on using Android Studio to get logs (for non-technical users). But after we switched to Timber, the logs now only display the class name without the namespace as the Tag, e.g. "NearbyActivity" instead of fr.free.nrw.etc. And it seems that when I debug externally, the Application is always ?

Does anyone know an easy way we can filter for logs from our app currently (that is teachable to non-technical folks)?

Would saving the logs to a text file not work? When reporting an issue, the user could just attach that file. Or is that not a recommended practice?

I believe an app can access its own logcat.
The app could do this when requested:
https://stackoverflow.com/questions/27957300/read-logcat-programmatically-for-an-application

Interesting! That could definitely be a future enhancement.

Cool, will try this out.

@misaochan How would this functionality work for the user? Would it build on the "Feedback" option provided in the navigation drawer? Or would a new option be added for example "Report Error" or something which would open the email app with a logs file attached? Or something entirely else?

We definitely need to discuss this prior to implementation. I can think of a few possible options, each with pros and cons:

  1. A setting in Settings. The user could turn it on when they want logs to be collected, perform the activities that they want a log for, and then turn it back off. However, there should probably be a constant indicator of that setting being on, since otherwise someone might forget about it.

Alternatively, if we only want retroactive logs (perhaps from when the app was started, like at https://stackoverflow.com/questions/12692103/read-logcat-programmatically-within-application), we could have a "Send logs" option in Settings that would open up a mail app with the logs appended (the way crash reports currently work). This might be the easiest solution.

  1. Enhancing the Feedback nav drawer option by taking the user to an activity where they can choose what gets sent as feedback, instead of sending them directly to a mail app as we currently do. In that new activity, they could turn on logging (or just get logs retroactively as mentioned above), then tap a "Send via email" button which would take them to the mail app with or without logs appended.

  2. New option in Nav drawer - I would not be in favour of this as it feels like bloat personally. But if Option 1 and 2 are unfeasible for various reasons, I'd be open to this.

New option in Nav drawer - I would not be in favour of this as it feels like bloat personally....

Agreed. Adding a new option just for reporting logs doesn't make sense especially when we already have the "Feedback" option there.

A setting in Settings. The user could turn it on when they want logs to be collected, perform the activities that they want a log for, and then turn it back off....

That seems like the most user friendly way of doing it, although I am not sure how it would work UI/UX wise. From the top of my head, it could be something like the Battery Saver mode where as soon as the user turns on the "Collect Logs" setting, the entire app gets surrounded by a thin strip indicating that logs are being collected. The user could turn off the setting to stop the log collection and then be taken to the email app with the logs file attached. I am not even remotely sure how to pull that off however.

Or we could keep things simple in terms of the UI/UX by using a persistent notification with a cross button indicating that logs are being collected. Tapping on the cross icon on that notification or turning the setting off in the settings menu would then do the same thing as mentioned above.

Alternatively, if we only want retroactive logs....

This gives me the Android Studio vibe where they ask every now and then about reporting usage statistics anonymously to Google. You can choose to reject it obviously but then you if you were to accept it, you would forget that there is such a thing. The difference in this case being that we will collect the logs on the device continuously and only send them across when the user wishes to which is good. But of course this should be the easiest to implement, unless I am missing something obvious.

I would be in favour of keeping development effort low, and the easiest
seems to be to put an action button in the settings menu (even though it is
not a "setting", just like Android shows its version number in the
settings), and make it take a logcat and launch an email activity with that
text.

On Tue, Oct 17, 2017 at 12:20 AM, Vishan Seru notifications@github.com
wrote:

New option in Nav drawer - I would not be in favour of this as it feels
like bloat personally....

Agreed. Adding a new option just for reporting logs doesn't make sense
especially when we already have the "Feedback" option there.

A setting in Settings. The user could turn it on when they want logs to be
collected, perform the activities that they want a log for, and then turn
it back off....

That seems like the most user friendly way of doing it, although I am not
sure how it would work UI/UX wise. From the top of my head, it could be
something like the Battery Saver mode where as soon as the user turns on
the "Collect Logs" setting, the entire app gets surrounded by a thin strip
indicating that logs are being collected. The user could turn off the
setting to stop the log collection and then be taken to the email app with
the logs file attached. I am not even remotely sure how to pull that off
however.

Or we could keep things simple in terms of the UI/UX by using a persistent
notification with a cross button indicating that logs are being collected.
Tapping on the cross icon on that notification or turning the setting off
in the settings menu would then do the same thing as mentioned above.

Alternatively, if we only want retroactive logs....

This gives me the Android Studio vibe where they ask every now and then
about reporting usage statistics anonymously to Google. You can choose to
reject it obviously but then you if you were to accept it, you would forget
that there is such a thing. The difference in this case being that we will
collect the logs on the device continuously and only send them across when
the user wishes to which is good. But of course this should be the easiest
to implement, unless I am missing something obvious.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/commons-app/apps-android-commons/issues/736#issuecomment-336920664,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAGFBkLfiABZdVVV1mg-eUtDMRZh1TMoks5ss3QlgaJpZM4N4oA7
.

I would be in favour of keeping development effort low, and the easiest
seems to be to put an action button in the settings menu (even though it is
not a "setting", just like Android shows its version number in the
settings), and make it take a logcat and launch an email activity with that
text.

This sounds good to me too. I'm not sure how far back we would want to collect them though, should we get everything from the time the app started? That could be very nonspecific, but probably the simplest way.

The difference in this case being that we will collect the logs on the device continuously and only send them across when the user wishes to which is good.

AFAIK the code in the StackOverflow link just pulls the entire logcat history since the time the app started, it doesn't need to "collect continuously".

Pulling the entire logcat history since the time the app started is perfect, I think.
When users encounter a bug, they will be able to immediately get a log for that bug, rather than having to try and reproduce the bug again.

Oh, yeah, good point. I agree. :)

So where are we planning to put this action button to trigger the email?

Possibly just a new item in Settings with the title "Send Logs" and the description "Send logs to developers via email"? Clicking on it could trigger the email.

Am open to any other suggestions.

Great first iteration.

Neat, will get started on this then.

Was this page helpful?
0 / 5 - 0 ratings