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: support changing loggers at runtime WPB-11541 #747

Merged
merged 3 commits into from
Nov 14, 2024

Conversation

typfel
Copy link
Member

@typfel typfel commented Nov 4, 2024

What's new in this PR

Support changing loggers and max log level at runtime.

also renamed initLogger in the bindings to setLogger since IMO init is not suitable anymore
when we allow replacing a logger.


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: ... ³
  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.

@typfel typfel requested a review from a team as a code owner November 4, 2024 18:09
@typfel typfel force-pushed the feat/flexible-logger-WPB-11541 branch 2 times, most recently from a067908 to b7d6bc0 Compare November 4, 2024 18:50
@codecov-commenter
Copy link

codecov-commenter commented Nov 4, 2024

Codecov Report

Attention: Patch coverage is 0% with 23 lines in your changes missing coverage. Please review.

Project coverage is 72.05%. Comparing base (ac0d5f9) to head (d7a83f4).

Files with missing lines Patch % Lines
crypto-ffi/src/generic/mod.rs 0.00% 23 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #747      +/-   ##
==========================================
- Coverage   72.12%   72.05%   -0.07%     
==========================================
  Files         106      106              
  Lines       19718    19737      +19     
==========================================
  Hits        14222    14222              
- Misses       5496     5515      +19     
Files with missing lines Coverage Δ
crypto-ffi/src/generic/mod.rs 0.00% <0.00%> (ø)

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 ac0d5f9...d7a83f4. Read the comment docs.

Copy link

github-actions bot commented Nov 4, 2024

🐰 Bencher Report

Branchfeat/flexible-logger-WPB-11541
Testbedubuntu-latest
Click to view all benchmark results
BenchmarkLatencynanoseconds (ns)
Commit add f(group size)/cs1/mem/1002📈 view plot
🚷 view threshold
18,580,000.00
Commit add f(group size)/cs1/mem/2📈 view plot
🚷 view threshold
6,766,200.00
Commit add f(group size)/cs1/mem/202📈 view plot
🚷 view threshold
9,121,400.00
Commit add f(group size)/cs1/mem/402📈 view plot
🚷 view threshold
11,472,000.00
Commit add f(group size)/cs1/mem/602📈 view plot
🚷 view threshold
14,644,000.00
Commit add f(group size)/cs1/mem/802📈 view plot
🚷 view threshold
17,182,000.00
Commit add f(number clients)/cs1/mem/1002📈 view plot
🚷 view threshold
976,760,000.00
Commit add f(number clients)/cs1/mem/2📈 view plot
🚷 view threshold
6,747,400.00
Commit add f(number clients)/cs1/mem/202📈 view plot
🚷 view threshold
83,636,000.00
Commit add f(number clients)/cs1/mem/402📈 view plot
🚷 view threshold
217,660,000.00
Commit add f(number clients)/cs1/mem/602📈 view plot
🚷 view threshold
420,990,000.00
Commit add f(number clients)/cs1/mem/802📈 view plot
🚷 view threshold
667,970,000.00
Commit pending proposals f(group size)/cs1/mem/1002📈 view plot
🚷 view threshold
115,890,000.00
Commit pending proposals f(group size)/cs1/mem/2📈 view plot
🚷 view threshold
28,019,000.00
Commit pending proposals f(group size)/cs1/mem/202📈 view plot
🚷 view threshold
45,223,000.00
Commit pending proposals f(group size)/cs1/mem/402📈 view plot
🚷 view threshold
60,370,000.00
Commit pending proposals f(group size)/cs1/mem/602📈 view plot
🚷 view threshold
79,160,000.00
Commit pending proposals f(group size)/cs1/mem/802📈 view plot
🚷 view threshold
94,400,000.00
Commit pending proposals f(pending size)/cs1/mem/1📈 view plot
🚷 view threshold
18,032,000.00
Commit pending proposals f(pending size)/cs1/mem/101📈 view plot
🚷 view threshold
114,310,000.00
Commit pending proposals f(pending size)/cs1/mem/21📈 view plot
🚷 view threshold
34,992,000.00
Commit pending proposals f(pending size)/cs1/mem/41📈 view plot
🚷 view threshold
55,825,000.00
Commit pending proposals f(pending size)/cs1/mem/61📈 view plot
🚷 view threshold
74,730,000.00
Commit pending proposals f(pending size)/cs1/mem/81📈 view plot
🚷 view threshold
94,508,000.00
Commit remove f(group size)/cs1/mem/1002📈 view plot
🚷 view threshold
26,824,000.00
Commit remove f(group size)/cs1/mem/2📈 view plot
🚷 view threshold
6,596,500.00
Commit remove f(group size)/cs1/mem/202📈 view plot
🚷 view threshold
8,576,700.00
Commit remove f(group size)/cs1/mem/402📈 view plot
🚷 view threshold
11,794,000.00
Commit remove f(group size)/cs1/mem/602📈 view plot
🚷 view threshold
17,389,000.00
Commit remove f(group size)/cs1/mem/802📈 view plot
🚷 view threshold
22,092,000.00
Commit remove f(number clients)/cs1/mem/1002📈 view plot
🚷 view threshold
30,097,000.00
Commit remove f(number clients)/cs1/mem/2📈 view plot
🚷 view threshold
136,240,000.00
Commit remove f(number clients)/cs1/mem/202📈 view plot
🚷 view threshold
114,290,000.00
Commit remove f(number clients)/cs1/mem/402📈 view plot
🚷 view threshold
92,723,000.00
Commit remove f(number clients)/cs1/mem/602📈 view plot
🚷 view threshold
71,664,000.00
Commit remove f(number clients)/cs1/mem/802📈 view plot
🚷 view threshold
50,209,000.00
Commit update f(group size)/cs1/mem/1002📈 view plot
🚷 view threshold
136,720,000.00
Commit update f(group size)/cs1/mem/2📈 view plot
🚷 view threshold
6,703,300.00
Commit update f(group size)/cs1/mem/202📈 view plot
🚷 view threshold
33,038,000.00
Commit update f(group size)/cs1/mem/402📈 view plot
🚷 view threshold
58,871,000.00
Commit update f(group size)/cs1/mem/602📈 view plot
🚷 view threshold
85,280,000.00
Commit update f(group size)/cs1/mem/802📈 view plot
🚷 view threshold
111,120,000.00
Count KeyPackage/cs1/mem/1002📈 view plot
🚷 view threshold
10,322,000.00
Count KeyPackage/cs1/mem/2📈 view plot
🚷 view threshold
6,507,900.00
Count KeyPackage/cs1/mem/202📈 view plot
🚷 view threshold
7,195,700.00
Count KeyPackage/cs1/mem/402📈 view plot
🚷 view threshold
7,729,200.00
Count KeyPackage/cs1/mem/602📈 view plot
🚷 view threshold
8,688,300.00
Count KeyPackage/cs1/mem/802📈 view plot
🚷 view threshold
9,679,500.00
Create group/cs1/mem📈 view plot
🚷 view threshold
6,518,600.00
Decrypt f(msg size)/cs1/mem/10📈 view plot
🚷 view threshold
6,268,200.00
Decrypt f(msg size)/cs1/mem/10010📈 view plot
🚷 view threshold
6,344,700.00
Decrypt f(msg size)/cs1/mem/2010📈 view plot
🚷 view threshold
6,254,500.00
Decrypt f(msg size)/cs1/mem/4010📈 view plot
🚷 view threshold
6,285,300.00
Decrypt f(msg size)/cs1/mem/6010📈 view plot
🚷 view threshold
6,272,400.00
Decrypt f(msg size)/cs1/mem/8010📈 view plot
🚷 view threshold
6,344,800.00
Encrypt f(group size)/cs1/mem/1002📈 view plot
🚷 view threshold
8,676,700.00
Encrypt f(group size)/cs1/mem/2📈 view plot
🚷 view threshold
6,243,500.00
Encrypt f(group size)/cs1/mem/202📈 view plot
🚷 view threshold
6,864,700.00
Encrypt f(group size)/cs1/mem/402📈 view plot
🚷 view threshold
7,502,200.00
Encrypt f(group size)/cs1/mem/602📈 view plot
🚷 view threshold
7,963,700.00
Encrypt f(group size)/cs1/mem/802📈 view plot
🚷 view threshold
8,283,400.00
Encrypt f(msg size)/cs1/mem/10📈 view plot
🚷 view threshold
8,514,700.00
Encrypt f(msg size)/cs1/mem/10010📈 view plot
🚷 view threshold
8,736,200.00
Encrypt f(msg size)/cs1/mem/2010📈 view plot
🚷 view threshold
8,385,600.00
Encrypt f(msg size)/cs1/mem/4010📈 view plot
🚷 view threshold
8,485,800.00
Encrypt f(msg size)/cs1/mem/6010📈 view plot
🚷 view threshold
8,729,100.00
Encrypt f(msg size)/cs1/mem/8010📈 view plot
🚷 view threshold
8,598,600.00
Generate KeyPackage f(group size)/cs1/mem/1002📈 view plot
🚷 view threshold
248,010,000.00
Generate KeyPackage f(group size)/cs1/mem/2📈 view plot
🚷 view threshold
6,679,000.00
Generate KeyPackage f(group size)/cs1/mem/202📈 view plot
🚷 view threshold
33,712,000.00
Generate KeyPackage f(group size)/cs1/mem/402📈 view plot
🚷 view threshold
87,065,000.00
Generate KeyPackage f(group size)/cs1/mem/602📈 view plot
🚷 view threshold
141,250,000.00
Generate KeyPackage f(group size)/cs1/mem/802📈 view plot
🚷 view threshold
194,720,000.00
Join from external commit f(group size)/cs1/mem/1002📈 view plot
🚷 view threshold
238,770,000.00
Join from external commit f(group size)/cs1/mem/2📈 view plot
🚷 view threshold
7,479,400.00
Join from external commit f(group size)/cs1/mem/202📈 view plot
🚷 view threshold
53,916,000.00
Join from external commit f(group size)/cs1/mem/402📈 view plot
🚷 view threshold
100,180,000.00
Join from external commit f(group size)/cs1/mem/602📈 view plot
🚷 view threshold
147,330,000.00
Join from external commit f(group size)/cs1/mem/802📈 view plot
🚷 view threshold
192,270,000.00
Join from welcome f(group size)/cs1/mem/1002📈 view plot
🚷 view threshold
113,630,000.00
Join from welcome f(group size)/cs1/mem/2📈 view plot
🚷 view threshold
7,040,300.00
Join from welcome f(group size)/cs1/mem/202📈 view plot
🚷 view threshold
28,494,000.00
Join from welcome f(group size)/cs1/mem/402📈 view plot
🚷 view threshold
49,867,000.00
Join from welcome f(group size)/cs1/mem/602📈 view plot
🚷 view threshold
71,270,000.00
Join from welcome f(group size)/cs1/mem/802📈 view plot
🚷 view threshold
92,661,000.00
Mls vs Proteus: add/MLS/mem/1📈 view plot
🚷 view threshold
6,712,300.00
Mls vs Proteus: add/MLS/mem/101📈 view plot
🚷 view threshold
7,878,100.00
Mls vs Proteus: add/MLS/mem/21📈 view plot
🚷 view threshold
6,967,400.00
Mls vs Proteus: add/MLS/mem/41📈 view plot
🚷 view threshold
7,342,000.00
Mls vs Proteus: add/MLS/mem/61📈 view plot
🚷 view threshold
7,516,200.00
Mls vs Proteus: add/MLS/mem/81📈 view plot
🚷 view threshold
7,767,200.00
Mls vs Proteus: add/Proteus/mem/1📈 view plot
🚷 view threshold
6,289,700.00
Mls vs Proteus: add/Proteus/mem/101📈 view plot
🚷 view threshold
44,885,000.00
Mls vs Proteus: add/Proteus/mem/21📈 view plot
🚷 view threshold
14,030,000.00
Mls vs Proteus: add/Proteus/mem/41📈 view plot
🚷 view threshold
22,245,000.00
Mls vs Proteus: add/Proteus/mem/61📈 view plot
🚷 view threshold
29,260,000.00
Mls vs Proteus: add/Proteus/mem/81📈 view plot
🚷 view threshold
36,845,000.00
Mls vs Proteus: encrypt/MLS/mem/1📈 view plot
🚷 view threshold
6,226,200.00
Mls vs Proteus: encrypt/MLS/mem/101📈 view plot
🚷 view threshold
6,500,600.00
Mls vs Proteus: encrypt/MLS/mem/21📈 view plot
🚷 view threshold
6,308,700.00
Mls vs Proteus: encrypt/MLS/mem/41📈 view plot
🚷 view threshold
6,357,600.00
Mls vs Proteus: encrypt/MLS/mem/61📈 view plot
🚷 view threshold
6,416,100.00
Mls vs Proteus: encrypt/MLS/mem/81📈 view plot
🚷 view threshold
6,574,800.00
Mls vs Proteus: encrypt/Proteus/mem/1📈 view plot
🚷 view threshold
6,086,200.00
Mls vs Proteus: encrypt/Proteus/mem/101📈 view plot
🚷 view threshold
16,126,000.00
Mls vs Proteus: encrypt/Proteus/mem/21📈 view plot
🚷 view threshold
8,074,100.00
Mls vs Proteus: encrypt/Proteus/mem/41📈 view plot
🚷 view threshold
9,992,700.00
Mls vs Proteus: encrypt/Proteus/mem/61📈 view plot
🚷 view threshold
12,048,000.00
Mls vs Proteus: encrypt/Proteus/mem/81📈 view plot
🚷 view threshold
13,842,000.00
Mls vs Proteus: remove/MLS/mem/1📈 view plot
🚷 view threshold
20,504,000.00
Mls vs Proteus: remove/MLS/mem/101📈 view plot
🚷 view threshold
8,243,800.00
Mls vs Proteus: remove/MLS/mem/21📈 view plot
🚷 view threshold
17,725,000.00
Mls vs Proteus: remove/MLS/mem/41📈 view plot
🚷 view threshold
15,693,000.00
Mls vs Proteus: remove/MLS/mem/61📈 view plot
🚷 view threshold
13,064,000.00
Mls vs Proteus: remove/MLS/mem/81📈 view plot
🚷 view threshold
10,454,000.00
Mls vs Proteus: remove/Proteus/mem/1📈 view plot
🚷 view threshold
6,078,400.00
Mls vs Proteus: remove/Proteus/mem/101📈 view plot
🚷 view threshold
7,182,900.00
Mls vs Proteus: remove/Proteus/mem/21📈 view plot
🚷 view threshold
6,267,800.00
Mls vs Proteus: remove/Proteus/mem/41📈 view plot
🚷 view threshold
6,759,200.00
Mls vs Proteus: remove/Proteus/mem/61📈 view plot
🚷 view threshold
6,764,100.00
Mls vs Proteus: remove/Proteus/mem/81📈 view plot
🚷 view threshold
7,132,000.00
Mls vs Proteus: update/MLS/mem/1📈 view plot
🚷 view threshold
6,753,900.00
Mls vs Proteus: update/MLS/mem/101📈 view plot
🚷 view threshold
20,517,000.00
Mls vs Proteus: update/MLS/mem/21📈 view plot
🚷 view threshold
9,680,300.00
Mls vs Proteus: update/MLS/mem/41📈 view plot
🚷 view threshold
12,477,000.00
Mls vs Proteus: update/MLS/mem/61📈 view plot
🚷 view threshold
14,951,000.00
Mls vs Proteus: update/MLS/mem/81📈 view plot
🚷 view threshold
17,841,000.00
Mls vs Proteus: update/Proteus/mem/1📈 view plot
🚷 view threshold
6,460,100.00
Mls vs Proteus: update/Proteus/mem/101📈 view plot
🚷 view threshold
46,940,000.00
Mls vs Proteus: update/Proteus/mem/21📈 view plot
🚷 view threshold
14,553,000.00
Mls vs Proteus: update/Proteus/mem/41📈 view plot
🚷 view threshold
22,705,000.00
Mls vs Proteus: update/Proteus/mem/61📈 view plot
🚷 view threshold
30,685,000.00
Mls vs Proteus: update/Proteus/mem/81📈 view plot
🚷 view threshold
38,780,000.00
🐰 View full continuous benchmarking report in Bencher

@istankovic
Copy link
Member

@typfel this is a breaking change, right?

@typfel
Copy link
Member Author

typfel commented Nov 8, 2024

@typfel this is a breaking change, right?

I kept the old API around in the wrapper but for iOS it would be a breaking change. I can fix that though.

@typfel typfel force-pushed the feat/flexible-logger-WPB-11541 branch from 7132e83 to 34e78cd Compare November 13, 2024 16:24
Currently it's only allowed to set a logger and log level once at runtime,
this restriction is annoying for clients since they setup and teardown the
core crypto stack when switching accounts. It also makes it harder than it
should be to have developer setting for increasing the core crypto log level.
@typfel
Copy link
Member Author

typfel commented Nov 14, 2024

@typfel this is a breaking change, right?

I kept the old API around in the wrapper but for iOS it would be a breaking change. I can fix that though.

I've re-introduced the old API and re-named the new API.

old: set_logger
new: set_logger_only

In the next release where we break the API we'll delete old method and rename the new API.

@typfel typfel merged commit 30d9db7 into main Nov 14, 2024
24 checks passed
@typfel typfel deleted the feat/flexible-logger-WPB-11541 branch November 14, 2024 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants