android-fhir icon indicating copy to clipboard operation
android-fhir copied to clipboard

Added HttpLogger as a configuration for FhirEngine.

Open aditya-07 opened this issue 2 years ago • 1 comments

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

  • [x] I have read and acknowledged the Code of conduct.
  • [x] I have read the Contributing page.
  • [x] I have signed the Google Individual CLA, or I am covered by my company's Corporate CLA.
  • [x] I have discussed my proposed solution with code owners in the linked issue(s) and we have agreed upon the general approach.
  • [x] I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the style guide of this project.
  • [x] I have run ./gradlew check and ./gradlew connectedCheck to test my changes locally.
  • [x] 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 avatar Aug 24 '22 11:08 aditya-07

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%) :arrow_down:
.../main/java/com/google/android/fhir/FhirServices.kt 55.00% <0.00%> (-4.46%) :arrow_down:
.../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.

codecov[bot] avatar Sep 13 '22 12:09 codecov[bot]