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

feat: add logger with userId and clientId #2139

Merged
merged 7 commits into from
Oct 17, 2023

Conversation

github-actions[bot]
Copy link
Contributor

Cherry pick from the original PR:


⚠️ Conflicts during cherry-pick:


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

Currently logs are not associated with specific user and client which makes debugging harder.

Solutions

Create a logger in user scope that can pass userId and clientId with each log.

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

* feat: add logger with userid and clientid

* update lib version

* added some documentation to the KaliumLogger tags

* moved creating string tag to Tag sealed class

* fix detekt

* fix tests
@github-actions github-actions bot added the cherry-pick PR is cherry-picking changes from another banch label Oct 16, 2023
@github-actions
Copy link
Contributor Author

github-actions bot commented Oct 16, 2023

Unit Test Results

       6 files   - 450         6 suites   - 450   3m 53s ⏱️ + 1m 31s
2 428 tests  - 109  2 412 ✔️  -   23  16 💤  - 86  0 ±0 

Results for commit b8f2c17. ± Comparison against base commit a71fb6d.

♻️ This comment has been updated with latest results.

@datadog-wireapp
Copy link

datadog-wireapp bot commented Oct 16, 2023

Datadog Report

All test runs 85a3f34 🔗

2 Total Test Services: 0 Failed, 0 with New Flaky, 2 Passed

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Wall Time Branch View
kalium-ios 0 0 0 2309 119 9m 54s Link
kalium-jvm 0 0 0 2430 102 14m 24s Link

@saleniuk saleniuk requested review from a team, typfel, gongracr, yamilmedina, borichellow and Garzas and removed request for a team October 16, 2023 16:33
Copy link
Contributor

@Garzas Garzas left a comment

Choose a reason for hiding this comment

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

Looking good, just small question for this cherry-pick 😄

@@ -39,8 +39,8 @@ jna = "5.13.0"
core-crypto = "1.0.0-rc.12"
core-crypto-multiplatform = "0.6.0-rc.3-multiplatform-pre1"
completeKotlin = "1.1.0"
desugar-jdk = "2.0.3"
kermit = "1.2.2"
desugar-jdk = "1.1.5"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why downgrading one lib?

Copy link
Contributor

Choose a reason for hiding this comment

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

IIRC, we can't downgrade to 1.x on develop without risking some crashes during runtime.

Copy link
Contributor

Choose a reason for hiding this comment

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

Automatic cherry-pick did that, it was supposed to just update kermit, I didn't notice that it also changed the one above, sorry about that. Reverted.

@@ -39,8 +39,8 @@ jna = "5.13.0"
core-crypto = "1.0.0-rc.12"
core-crypto-multiplatform = "0.6.0-rc.3-multiplatform-pre1"
completeKotlin = "1.1.0"
desugar-jdk = "2.0.3"
kermit = "1.2.2"
desugar-jdk = "1.1.5"
Copy link
Contributor

Choose a reason for hiding this comment

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

IIRC, we can't downgrade to 1.x on develop without risking some crashes during runtime.

@codecov-commenter
Copy link

Codecov Report

Merging #2139 (b8f2c17) into develop (a71fb6d) will decrease coverage by 0.01%.
The diff coverage is 38.31%.

@@              Coverage Diff              @@
##             develop    #2139      +/-   ##
=============================================
- Coverage      57.74%   57.73%   -0.01%     
+ Complexity        24       21       -3     
=============================================
  Files           1052     1052              
  Lines          40027    40057      +30     
  Branches        3716     3719       +3     
=============================================
+ Hits           23113    23128      +15     
- Misses         15305    15322      +17     
+ Partials        1609     1607       -2     
Files Coverage Δ
...etworkContainer/AuthenticatedNetworkContainerV0.kt 26.47% <100.00%> (+2.22%) ⬆️
...com/wire/kalium/cryptography/CryptographyLogger.kt 33.33% <0.00%> (+20.83%) ⬆️
...otlin/com/wire/kalium/network/NetworkUtilLogger.kt 50.00% <50.00%> (+27.77%) ⬆️
...in/kotlin/com/wire/kalium/network/NetworkLogger.kt 33.33% <0.00%> (+22.22%) ⬆️
...n/com/wire/kalium/persistence/PersistenceLogger.kt 33.33% <0.00%> (+20.83%) ⬆️
...kotlin/com/wire/kalium/network/KaliumHttpLogger.kt 0.00% <0.00%> (ø)
...in/kotlin/com/wire/kalium/network/NetworkClient.kt 75.38% <57.14%> (-0.43%) ⬇️
...com/wire/kalium/network/KaliumKtorCustomLogging.kt 0.00% <0.00%> (ø)
...etworkContainer/AuthenticatedNetworkContainerV3.kt 0.00% <0.00%> (ø)
...etworkContainer/AuthenticatedNetworkContainerV4.kt 0.00% <0.00%> (ø)
... and 5 more

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a71fb6d...b8f2c17. Read the comment docs.

@vitorhugods vitorhugods added this pull request to the merge queue Oct 17, 2023
@vitorhugods vitorhugods removed this pull request from the merge queue due to a manual request Oct 17, 2023
@vitorhugods vitorhugods merged commit f113b06 into develop Oct 17, 2023
17 checks passed
@vitorhugods vitorhugods deleted the feat/logger-with-userid-and-clientid-cherry-pick branch October 17, 2023 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants