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 #2100

Merged
merged 7 commits into from
Oct 16, 2023

Conversation

saleniuk
Copy link
Contributor

@saleniuk saleniuk commented Sep 27, 2023


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.

Copy link
Member

@vitorhugods vitorhugods left a comment

Choose a reason for hiding this comment

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

Nicely done!

Not only this adds the possibility of adding a User/Client to the logs, but it also fixes the issue where tags keep changing due to it being mutable inside KaliumLogger.

Just some suggestions to add Kdocs to the new Tag class and the fields/functions where it can be used

@github-actions
Copy link
Contributor

github-actions bot commented Oct 11, 2023

Unit Test Results

   410 files     410 suites   24s ⏱️
2 251 tests 2 131 ✔️ 120 💤 0

Results for commit 21dd96f.

♻️ This comment has been updated with latest results.

@datadog-wireapp
Copy link

datadog-wireapp bot commented Oct 11, 2023

Datadog Report

All test runs f01d759 🔗

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 2131 120 43m 10s Link
kalium-jvm 0 0 0 2238 108 12m 18.01s Link

@codecov-commenter
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (release/candidate@49c569f). Click here to learn what that means.
The diff coverage is n/a.

@@                 Coverage Diff                  @@
##             release/candidate    #2100   +/-   ##
====================================================
  Coverage                     ?   58.08%           
  Complexity                   ?       21           
====================================================
  Files                        ?     1004           
  Lines                        ?    37639           
  Branches                     ?     3436           
====================================================
  Hits                         ?    21862           
  Misses                       ?    14306           
  Partials                     ?     1471           

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 49c569f...21dd96f. Read the comment docs.

@saleniuk saleniuk marked this pull request as ready for review October 11, 2023 15:26
@saleniuk saleniuk requested review from a team, gongracr, yamilmedina, MohamadJaara, mchenani and Garzas and removed request for a team October 11, 2023 15:26
@saleniuk saleniuk merged commit 3e3de98 into release/candidate Oct 16, 2023
14 checks passed
@saleniuk saleniuk deleted the feat/logger-with-userid-and-clientid branch October 16, 2023 13:04
github-actions bot pushed a commit that referenced this pull request Oct 16, 2023
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants