[PR #1663] [MERGED] BEEEP: Abstract and Centralize Logging #3040

Closed
opened 2025-11-26 23:27:30 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/1663
Author: @fedemkr
Created: 11/26/2021
Status: Merged
Merged: 3/2/2022
Merged by: @fedemkr

Base: masterHead: logging-abstraction


📝 Commits (7)

  • d8f60c1 Abstracted App Center Logging into its own component, so that we can have it centralized in one place and we avoid checking for FDroid on all the places we want to use it
  • 7b7363f Merge branch 'master' into logging-abstraction
  • f6bd591 Merge branch 'master' into logging-abstraction
  • ff2add8 Implemented the new logger where Crashes.TrackError was being used except on some specific cases
  • faa241a Merge branch 'master' into logging-abstraction
  • 0350fb5 Merge branch 'master' into logging-abstraction
  • 5a37bb9 Improved logging, added a debug logger and removed AppCenter to be used on DEBUG

📊 Changes

32 files changed (+328 additions, -147 deletions)

View changed files

📝 src/Android/Autofill/AutofillService.cs (+7 -13)
📝 src/Android/MainActivity.cs (+1 -1)
📝 src/Android/MainApplication.cs (+10 -2)
📝 src/Android/Services/AndroidLogService.cs (+1 -1)
📝 src/App/Controls/AccountSwitchingOverlay/AccountSwitchingOverlayView.xaml.cs (+7 -12)
📝 src/App/Controls/AccountSwitchingOverlay/AccountSwitchingOverlayViewModel.cs (+3 -5)
📝 src/App/Pages/Accounts/DeleteAccountViewModel.cs (+8 -10)
📝 src/App/Pages/Accounts/HomePageViewModel.cs (+2 -1)
📝 src/App/Pages/Accounts/LockPageViewModel.cs (+4 -7)
📝 src/App/Pages/Accounts/LoginPageViewModel.cs (+4 -7)
📝 src/App/Pages/Accounts/VerificationCodeViewModel.cs (+11 -16)
📝 src/App/Pages/Generator/GeneratorHistoryPageViewModel.cs (+3 -6)
📝 src/App/Pages/Send/SendAddEditPage.xaml.cs (+2 -6)
📝 src/App/Pages/Send/SendAddEditPageViewModel.cs (+4 -6)
📝 src/App/Pages/Settings/ExportVaultPageViewModel.cs (+7 -10)
📝 src/App/Pages/Vault/AddEditPageViewModel.cs (+11 -12)
📝 src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs (+3 -1)
📝 src/App/Pages/Vault/ScanPage.xaml.cs (+5 -4)
📝 src/App/Utilities/ThemeManager.cs (+5 -11)
src/Core/Abstractions/ILogger.cs (+26 -0)

...and 12 more files

📄 Description

Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

Added a Logger in order to centralize logging exceptions

Code changes

  • ILogger, Logger.cs: Added this file to centralize and abstract the logging logic
  • StubLogger.cs: Added this file to use it on FDROID so that it doesn't use AppCenter
  • INativeLogService: Renamed ILogService to INativeLogService to be more specific and differentiate it from the new one.
  • Other: Implemented new ILogger where Crashes.TrackError was being used except on some specific cases where for now it's more convenient to keep using the old way just in case the ILogger couldn't be resolved because of some scenario

Testing requirements

Maybe a quick test on delete account and export vault to check that the action is done correctly. Very little was changed there. And check that overall the app behaves and doesn't crash when opening some screen.

Before you submit

  • I have added unit tests where it makes sense to do so (encouraged but not required)
  • This change requires a documentation update (notify the documentation team)
  • This change has particular deployment requirements (notify the DevOps team)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/1663 **Author:** [@fedemkr](https://github.com/fedemkr) **Created:** 11/26/2021 **Status:** ✅ Merged **Merged:** 3/2/2022 **Merged by:** [@fedemkr](https://github.com/fedemkr) **Base:** `master` ← **Head:** `logging-abstraction` --- ### 📝 Commits (7) - [`d8f60c1`](https://github.com/bitwarden/android/commit/d8f60c101a3ede0ee8cd616cf90692ecfbba0f0e) Abstracted App Center Logging into its own component, so that we can have it centralized in one place and we avoid checking for FDroid on all the places we want to use it - [`7b7363f`](https://github.com/bitwarden/android/commit/7b7363fda55b8741bf14a44689088878c090e155) Merge branch 'master' into logging-abstraction - [`f6bd591`](https://github.com/bitwarden/android/commit/f6bd591d6a1fc29f55bf84eddbbcc682b1c1e4da) Merge branch 'master' into logging-abstraction - [`ff2add8`](https://github.com/bitwarden/android/commit/ff2add80bb0cf62b5616e11f791bbe9060c90140) Implemented the new logger where Crashes.TrackError was being used except on some specific cases - [`faa241a`](https://github.com/bitwarden/android/commit/faa241a1a7e6b96440c6f352227b172558aab138) Merge branch 'master' into logging-abstraction - [`0350fb5`](https://github.com/bitwarden/android/commit/0350fb5d62cf622e6302539ff5e1034569bd199a) Merge branch 'master' into logging-abstraction - [`5a37bb9`](https://github.com/bitwarden/android/commit/5a37bb93975638b69160f8a6bc889bd4bc8f1bca) Improved logging, added a debug logger and removed AppCenter to be used on DEBUG ### 📊 Changes **32 files changed** (+328 additions, -147 deletions) <details> <summary>View changed files</summary> 📝 `src/Android/Autofill/AutofillService.cs` (+7 -13) 📝 `src/Android/MainActivity.cs` (+1 -1) 📝 `src/Android/MainApplication.cs` (+10 -2) 📝 `src/Android/Services/AndroidLogService.cs` (+1 -1) 📝 `src/App/Controls/AccountSwitchingOverlay/AccountSwitchingOverlayView.xaml.cs` (+7 -12) 📝 `src/App/Controls/AccountSwitchingOverlay/AccountSwitchingOverlayViewModel.cs` (+3 -5) 📝 `src/App/Pages/Accounts/DeleteAccountViewModel.cs` (+8 -10) 📝 `src/App/Pages/Accounts/HomePageViewModel.cs` (+2 -1) 📝 `src/App/Pages/Accounts/LockPageViewModel.cs` (+4 -7) 📝 `src/App/Pages/Accounts/LoginPageViewModel.cs` (+4 -7) 📝 `src/App/Pages/Accounts/VerificationCodeViewModel.cs` (+11 -16) 📝 `src/App/Pages/Generator/GeneratorHistoryPageViewModel.cs` (+3 -6) 📝 `src/App/Pages/Send/SendAddEditPage.xaml.cs` (+2 -6) 📝 `src/App/Pages/Send/SendAddEditPageViewModel.cs` (+4 -6) 📝 `src/App/Pages/Settings/ExportVaultPageViewModel.cs` (+7 -10) 📝 `src/App/Pages/Vault/AddEditPageViewModel.cs` (+11 -12) 📝 `src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs` (+3 -1) 📝 `src/App/Pages/Vault/ScanPage.xaml.cs` (+5 -4) 📝 `src/App/Utilities/ThemeManager.cs` (+5 -11) ➕ `src/Core/Abstractions/ILogger.cs` (+26 -0) _...and 12 more files_ </details> ### 📄 Description ## Type of change - [ ] Bug fix - [ ] New feature development - [X] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective <!--Describe what the purpose of this PR is. For example: what bug you're fixing or what new feature you're adding--> Added a Logger in order to centralize logging exceptions ## Code changes <!--Explain the changes you've made to each file or major component. This should help the reviewer understand your changes--> <!--Also refer to any related changes or PRs in other repositories--> * **ILogger, Logger.cs:** Added this file to centralize and abstract the logging logic * **StubLogger.cs:** Added this file to use it on FDROID so that it doesn't use AppCenter * **INativeLogService:** Renamed `ILogService` to `INativeLogService` to be more specific and differentiate it from the new one. * **Other:** Implemented new `ILogger` where `Crashes.TrackError` was being used except on some specific cases where for now it's more convenient to keep using the old way just in case the `ILogger` couldn't be resolved because of some scenario ## Testing requirements <!--What functionality requires testing by QA? This includes testing new behavior and regression testing--> Maybe a quick test on delete account and export vault to check that the action is done correctly. Very little was changed there. And check that overall the app behaves and doesn't crash when opening some screen. ## Before you submit - [ ] I have added **unit tests** where it makes sense to do so (encouraged but not required) - [ ] This change requires a **documentation update** (notify the documentation team) - [ ] This change has particular **deployment requirements** (notify the DevOps team) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-26 23:27:30 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#3040