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

feat: Add atSign to AtSignLoggers' names when feasible. Some code simplification and refactoring #870

Merged
merged 11 commits into from
Jan 11, 2023

Conversation

gkc
Copy link
Contributor

@gkc gkc commented Jan 5, 2023

Closes #869

- What I did

  • feat: Add atSign to AtSignLoggers' names when relevant, so that log messages are clearer. For example in AtClientImpl we've changed from just declaring final _logger = AtSignLogger('AtClientImpl'); to instead declaring late final AtSignLogger _logger; and later, in constructor, _logger = AtSignLogger('AtClientImpl ($_atSign)');
  • fix: Moved one-time logic from within the while loop to before it, in SyncServiceImpl._informSyncProgress
  • refactor: Changed names of internal variables in AtClientImpl from "currentAtSign" to "atSign"
  • feat: Added setters and getters to AtClient spec for notificationService and syncService. AtClientManager.setCurrentAtSign now sets those values on the AtClient
  • refactor: Reduced usage of AtClientManager.getInstance()
  • refactor: Removed all usages (in the at_client package) of AtClientManager's syncService and notificationService instance variables now that both of them are available via the AtClient
  • refactor: Removed AtClientManager's public notificationService and syncService instance variables and replaced with getters which will now return _currentAtClient!.syncService and _currentAtClient!.notificationService respectively

- How to verify it
Tests should pass

- Description for the changelog
feat: Add atSign to AtSignLoggers' names when relevant, so that log messages are clearer
feat: Made notificationService and syncService available via AtClient to enable cleaner simpler code elsewhere

gkc added 7 commits January 5, 2023 16:42
…essages are clearer. For example in AtClientImpl instead of `final _logger = AtSignLogger('AtClientImpl');` we declare `late final AtSignLogger _logger;` and later, in constructor, `_logger = AtSignLogger('AtClientImpl ($_atSign)');`

refactor: Changed names of internal variables in AtClientImpl from "currentAtSign" to "atSign"
feat: Added setters and getters to AtClient spec for notification and sync services
refactor: Reduced usage of AtClientManager.getInstance()
…ign` to prevent uninitialized field error when trying to set previousAtSign so we can later log that we have switched from previousAtSign to _atSign
fix: Moved one-time logic from within the while loop to before it, in `SyncServiceImpl._informSyncProgress`
# Conflicts:
#	packages/at_client/lib/src/client/at_client_impl.dart
#	packages/at_client/lib/src/client/at_client_spec.dart
#	packages/at_client/lib/src/decryption_service/shared_key_decryption.dart
#	packages/at_client/lib/src/manager/at_client_manager.dart
#	packages/at_client/lib/src/service/encryption_service.dart
#	packages/at_client/lib/src/service/notification_service_impl.dart
#	packages/at_client/test/decryption_service_test.dart
…entManager.notificationService now that both of them are available via the AtClient (AtClient.syncService and AtClient.notificationService). Removed the AtClientManager.notificationService and AtClientManager.syncService instance variables
@gkc gkc changed the title feat: Add atSign to AtSignLoggers' names when relevant, so that log messages are clearer feat: Add atSign to AtSignLoggers' names when feasible. Some code simplification and refactoring Jan 10, 2023
@gkc gkc marked this pull request as ready for review January 10, 2023 17:36
@gkc gkc merged commit c3dcf33 into trunk Jan 11, 2023
@gkc gkc deleted the gkc-log-the-atsign branch January 11, 2023 10:59
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.

Add atSign to log messages in at_client_sdk
3 participants