Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Conversation

@AndroidMedaGalaxy
Copy link
Member

Description

Log improvement where the PR tries to introduce more point of logs and information about Background Workers and their operations

Steps to reproduce

Test Menu > Debug Options > Logfiled enabled togled to true > Share Log button > Observe the saved file location

How to get to the file.

  1. You can use Device Explorer from Android Studio
  2. Can use File explorer in the device to get to the file

@AndroidMedaGalaxy AndroidMedaGalaxy added the maintainers Tag pull requests created by maintainers label Nov 9, 2020
Copy link
Contributor

@harambasicluka harambasicluka left a comment

Choose a reason for hiding this comment

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

IMHO the ticket was about adding a log when the high risk notification is send and also log "the notification permissions for the app to ensure everything is configured right". So please add logs in this locations.

Notification Permissions logged and notification sent is loggged
@AndroidMedaGalaxy
Copy link
Member Author

IMHO the ticket was about adding a log when the high risk notification is send and also log "the notification permissions for the app to ensure everything is configured right". So please add logs in this locations.

Hi Luka,

The changes have been pushed. Please check them out

chiljamgossow
chiljamgossow previously approved these changes Nov 10, 2020
Copy link
Contributor

@chiljamgossow chiljamgossow left a comment

Choose a reason for hiding this comment

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

Some minor suggestions. Since it is only for debugging, it's also fine if you leave it as it is.

}
}

Timber.d("$id: doWork() finished with %s", result)
Copy link
Contributor

Choose a reason for hiding this comment

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

I there a reason you do not write Timber.d("$id: doWork() finished with $result")?

Copy link
Member

Choose a reason for hiding this comment

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

Doesn't matter here I think, but the difference would be:

The solution with %s using string formatting would defer the toString evaluation until it's actually needed. So in the scenario where result is a complex object (i.e. a list of complex objects), we would not evaluate it toString() if logging is disabled (internal optimization in Timber).


if (runAttemptCount > BackgroundConstants.WORKER_RETRY_COUNT_THRESHOLD) {
Timber.d("Background job failed after $runAttemptCount attempts. Rescheduling")
Timber.d("$id Background job failed after $runAttemptCount attempts. Rescheduling")
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: Maybe also use doWork() instead of Background job in the log here for consistency?

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense.

harambasicluka
harambasicluka previously approved these changes Nov 10, 2020
Copy link
Contributor

@harambasicluka harambasicluka left a comment

Choose a reason for hiding this comment

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

It's fine from my point of view but please discuss the open points with @chiljamgossow :)

Copy link
Contributor

@chiljamgossow chiljamgossow left a comment

Choose a reason for hiding this comment

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

Looks fine to me

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@harambasicluka harambasicluka merged commit 1672693 into release/1.7.x Nov 11, 2020
@harambasicluka harambasicluka deleted the feature/logs-implmentation-for-analysis branch November 11, 2020 12:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

maintainers Tag pull requests created by maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants