Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save logs locally #3604

Merged
merged 1 commit into from
Aug 2, 2024
Merged

Conversation

Navid200
Copy link
Collaborator

@Navid200 Navid200 commented Aug 1, 2024

This PR adds the ability to save logs locally in the mobile storage.

Fixes: #1864

There are times one may need to save their logs for their own reference.
There are times one may want to submit logs to someone other than the lead developer.
There has been a request by someone who used a full Android watch claiming that the font size was so small on their screen that they could see nothing in the logs.

The output is saved in the /Download/xDrip-export folder, which is where the settings file is saved.
The same as the settings file, the output overwrites the previous export.

The new method packLogs packages the logs. The content used to be inside the SendFeedBack file. The new method is in EventLogActivity file that calls both SendFeedBack and the new SendLogs methods. This way, the same pack method is used for both options to minimize code duplications.

This is what the Event Logs page looks like after this with a new button at the bottom for saving the logs instead of sending the,
Screenshot_20240731-195828

The send feedback page shows a new warning at the top, which is also shown on the save logs page.
Screenshot_20240731-200049
Other than this new warning, nothing has changed on the send feedback page.

The new save logs page is shown below.
Screenshot_20240731-200301

The warning is translated so that users can understand better. And considering the warning is for users, not for developers, it makes sense to translate it.
The logs themselves remain in English as they should be.

Tests:
Tested with Android 8, 9, 11 and 15.
For testing the existing function of sending the logs to you, I did send logs about an hour ago. There has been a slight change to the format of the logs that you receive. Please look at what you got and tell me if it is broken.

If there is anything you don't like, please tell me.

Thanks

@Navid200
Copy link
Collaborator Author

Navid200 commented Aug 1, 2024

I just tested this on Android 7 using a virtual machine in Android Studio and it works fine.
Screenshot 2024-08-01 092052

@Navid200
Copy link
Collaborator Author

Navid200 commented Aug 2, 2024

The new save logs button appears between the two existing buttons as shown below when we are not at the top of the list.
Screenshot_20240801_232547

@Navid200
Copy link
Collaborator Author

Navid200 commented Aug 2, 2024

After a successful save, a log shows where the log file has been saved.
There is no toast intentionally. A toast can be missed and it is really annoying when you notice a toast but are not fast enough reading it.
In this case, the log is perfect because after the save log button is tapped, we are automatically taken back to the event logs screen where we can see the log showing where the file has been saved.

@Navid200
Copy link
Collaborator Author

Navid200 commented Aug 2, 2024

The log file is not zipped as it is not being emailed. I didn't think it would be a very large file.

@jamorham jamorham merged commit 233cd68 into NightscoutFoundation:master Aug 2, 2024
1 check passed
@Navid200 Navid200 deleted the Navid_2021_12_21b branch August 2, 2024 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Give option to save Error and Event List log file locally
2 participants