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

RUMM-2754: Create implementation of InternalLogger #1155

Conversation

0xnm
Copy link
Member

@0xnm 0xnm commented Nov 23, 2022

What does this PR do?

Simple implementation of InternalLogger interface which forwards logs according to the target specified.

Task RUMM-2764 created to start using it in the codebase, not a part of SDK v2 goals.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@0xnm 0xnm requested a review from a team as a code owner November 23, 2022 16:37
@xgouchet xgouchet added the size-medium This PR is medium sized label Nov 23, 2022
@0xnm 0xnm force-pushed the nogorodnikov/rumm-2754/create-implementation-of-internal-logger branch from 737fb93 to cf0fddb Compare November 23, 2022 17:55
@codecov-commenter
Copy link

codecov-commenter commented Nov 23, 2022

Codecov Report

Merging #1155 (cf0fddb) into feature/sdkv2 (d451d7e) will increase coverage by 0.03%.
The diff coverage is 92.59%.

@@                Coverage Diff                @@
##           feature/sdkv2    #1155      +/-   ##
=================================================
+ Coverage          82.28%   82.31%   +0.03%     
=================================================
  Files                353      354       +1     
  Lines              11796    11822      +26     
  Branches            2007     2012       +5     
=================================================
+ Hits                9706     9731      +25     
- Misses              1465     1468       +3     
+ Partials             625      623       -2     
Impacted Files Coverage Δ
...otlin/com/datadog/android/v2/api/InternalLogger.kt 100.00% <ø> (ø)
...n/com/datadog/android/v2/core/SdkInternalLogger.kt 92.31% <92.31%> (ø)
...in/com/datadog/android/core/internal/SdkFeature.kt 89.09% <100.00%> (ø)
...android/log/internal/logger/TelemetryLogHandler.kt 85.71% <0.00%> (-14.29%) ⬇️
...src/main/kotlin/com/datadog/android/DatadogSite.kt 83.33% <0.00%> (-3.33%) ⬇️
...android/log/internal/domain/DatadogLogGenerator.kt 94.59% <0.00%> (-0.68%) ⬇️
.../android/rum/internal/monitor/DatadogRumMonitor.kt 92.78% <0.00%> (-0.56%) ⬇️
.../android/rum/internal/domain/scope/RumViewScope.kt 95.24% <0.00%> (ø)
...android/v2/core/internal/DatadogContextProvider.kt 81.54% <0.00%> (ø)
...droid/rum/tracking/FragmentViewTrackingStrategy.kt 75.00% <0.00%> (ø)
... and 2 more

attributes: Map<String, Any?>
) {
when (target) {
// TODO RUMM-2764 we should remove sdkLogger, devLogger and telemetry
Copy link
Member

Choose a reason for hiding this comment

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

Good point

error: Throwable?,
attributes: Map<String, Any?>
) {
devLogger.log(
Copy link
Member

Choose a reason for hiding this comment

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

you don't want to pass sdkLogger, devLogger and telemetry as dependencies or the problem is that they cannot be yet initialized ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, don't want to reference them in the constructor. Anyway it has no real benefit (other than mocking).

Copy link
Member

@mariusc83 mariusc83 left a comment

Choose a reason for hiding this comment

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

Great work

Copy link
Member

@xgouchet xgouchet left a comment

Choose a reason for hiding this comment

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

Nice work !

@0xnm 0xnm merged commit 76058cd into feature/sdkv2 Nov 24, 2022
@0xnm 0xnm deleted the nogorodnikov/rumm-2754/create-implementation-of-internal-logger branch November 24, 2022 13:11
@xgouchet xgouchet added this to the 1.16.0 milestone Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size-medium This PR is medium sized
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants