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

Added HttpLogger as a configuration for FhirEngine. #1570

Merged
merged 21 commits into from
Oct 4, 2022

Conversation

aditya-07
Copy link
Collaborator

IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).

Fixes #1426

Description

Issue:
There is no way for clients to listen / log the Http communication between engine and server.

Solution:
Added HttpLogger as part of server configuration of the FhirEngine to be specified by the developer application. The HttpLogger takes a lambda that is called with the log message based on the logging HttpLogger.Level specified by the application as part of HttpLogger.Configuration

Alternative(s) considered
Have you considered any alternatives? And if so, why have you chosen the approach in this PR?

Type
Choose one: Feature
Screenshots (if applicable)

Checklist

  • I have read and acknowledged the Code of conduct.
  • I have read the Contributing page.
  • I have signed the Google Individual CLA, or I am covered by my company's Corporate CLA.
  • I have discussed my proposed solution with code owners in the linked issue(s) and we have agreed upon the general approach.
  • I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the style guide of this project.
  • I have run ./gradlew check and ./gradlew connectedCheck to test my changes locally.
  • I have built and run the demo app(s) to verify my change fixes the issue and/or does not break the demo app(s).

@aditya-07 aditya-07 assigned jingtang10 and joiskash and unassigned aditya-07 Sep 13, 2022
Copy link
Collaborator

@joiskash joiskash left a comment

Choose a reason for hiding this comment

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

Just a few nits in the comments, but otherwise this looks great! Thanks a lot!

@joiskash joiskash assigned aditya-07 and unassigned joiskash Sep 13, 2022
@codecov
Copy link

codecov bot commented Sep 13, 2022

Codecov Report

Merging #1570 (a8a2f42) into master (a939137) will decrease coverage by 0.17%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##             master    #1570      +/-   ##
============================================
- Coverage     36.54%   36.36%   -0.18%     
  Complexity      330      330              
============================================
  Files           147      149       +2     
  Lines          4923     4947      +24     
  Branches        877      879       +2     
============================================
  Hits           1799     1799              
- Misses         2886     2910      +24     
  Partials        238      238              
Impacted Files Coverage Δ
...java/com/google/android/fhir/FhirEngineProvider.kt 4.25% <0.00%> (-0.10%) ⬇️
.../main/java/com/google/android/fhir/FhirServices.kt 55.00% <0.00%> (-4.46%) ⬇️
.../com/google/android/fhir/sync/remote/HttpLogger.kt 0.00% <0.00%> (ø)
...google/android/fhir/sync/remote/MoreHttpLoggers.kt 0.00% <0.00%> (ø)
...ogle/android/fhir/sync/remote/RemoteFhirService.kt 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@aditya-07 aditya-07 removed their assignment Sep 15, 2022
Copy link
Collaborator

@jingtang10 jingtang10 left a comment

Choose a reason for hiding this comment

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

a few small comments. but i also would be happy if there's some test coverage at least to check we're setting up the http logging intercepter in okhttp correctly.

@jingtang10 jingtang10 assigned aditya-07 and unassigned jingtang10 Sep 21, 2022
@jingtang10 jingtang10 assigned aditya-07 and unassigned jingtang10 Sep 27, 2022
Copy link
Collaborator

@joiskash joiskash left a comment

Choose a reason for hiding this comment

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

Just a small comment, but otherwise looks good to me!

@jingtang10 jingtang10 assigned aditya-07 and unassigned jingtang10 Sep 30, 2022
Copy link
Collaborator

@jingtang10 jingtang10 left a comment

Choose a reason for hiding this comment

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

the new tests look great! thanks for this aditya!

@aditya-07 aditya-07 merged commit e4c7b78 into google:master Oct 4, 2022
@aditya-07 aditya-07 deleted the ak/http-logger branch April 19, 2023 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

Logging HTTP API calls that are invoked by the FHIR Engine while syncing
4 participants