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

Adopt Log service and DataStoreService changes from Core 2.0 #77

Merged
merged 6 commits into from
Dec 5, 2022

Conversation

prudrabhat
Copy link
Contributor

@prudrabhat prudrabhat commented Nov 29, 2022

Description

Core 2.0 now provides a Log service and a DataStoreService. Use these to replace existing logging and storage management logic.

- Replace MobileCore.log with Log.* in non-test classes
- Rename IdentityStorageService to IdentityStorageManager
- Make IdentityStorageService non static and inject dependency from EdgeIdentityExtension
- Fix a mistake in Identity Direct name

Related Issue

MOB-17069

Motivation and Context

Core 2.0 now provides a Log service and a DataStoreService. Use these to replace existing logging and storage management logic.

How Has This Been Tested?

  • Verified via Test app.
  • Test changes will be made as a follow up PR

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

- Make IdentityStorageService methods non-static and inject from constuctor
- Rename IdentityStorageService to IdentityStorageManager
@@ -43,9 +44,9 @@ final class ECID {
*/
ECID(final String ecidString) {
if (StringUtils.isNullOrEmpty(ecidString)) {
MobileCore.log(
LoggingMode.DEBUG,
Log.debug(
IdentityConstants.LOG_TAG,
Copy link
Contributor

@addb addb Dec 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's standardize usage of logs.

Few files have import static com.adobe.marketing.mobile.edge.identity.IdentityConstants.LOG_TAG;

I prefer IdentityConstants.LOG_TAG > import com.adobe.marketing.mobile.edge.identity.IdentityConstants.LOG_TAG

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this occurrence has a qualified import 😕 (because I did a replace all)!
I don't mind either way, but if I had to choose I would be inclined towards the static import as it is less verbose (especially when used a lot of time in the class) and also because it is an unambiguous import.

Copy link
Contributor

@emdobrin emdobrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Left a question for the test coverage, but feel free to take that in the tests PR

@prudrabhat prudrabhat merged commit 8384998 into adobe:dev-v2.0.0 Dec 5, 2022
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.

4 participants