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

fix: logging for momento clients #72

Merged
merged 9 commits into from
Dec 6, 2023
Merged

fix: logging for momento clients #72

merged 9 commits into from
Dec 6, 2023

Conversation

anitarua
Copy link
Collaborator

@anitarua anitarua commented Dec 1, 2023

Addresses #55

Attempt 3

No LogProvider, just the swift-log library

Attempt 2

Uses Apple's swift-log library to create Loggers that can direct logs to any user-specified logging backend. Removed the Momento logger factory files and modified the LogProvider class to keep track of the minimum logging level across all Momento clients and to create new Loggers using that specified level.

Did some local testing and saw logs of the format: 2023-12-04T14:22:02-0800 info PubsubClient : [Momento] initialized logger

Attempt 1

First least worst idea was to allow each client to set their own logger factory within the LogProvider class. This means each client would have to know which logger to call, but it would allow a user to set separate logging levels for their cache and topic clients and all the logic for deciding which logger factory to use is internal.

Open to other suggestions though!

@anitarua anitarua marked this pull request as ready for review December 1, 2023 19:50
@anitarua anitarua requested a review from pgautier404 December 1, 2023 19:50
@anitarua anitarua changed the title fix: static LogProvider with non-conflicting logger factories for topic and cache clients fix: logging for momento clients Dec 4, 2023
@anitarua anitarua marked this pull request as draft December 4, 2023 21:23
@anitarua anitarua marked this pull request as ready for review December 4, 2023 23:14
README.md Show resolved Hide resolved
Copy link
Collaborator

@pgautier404 pgautier404 left a comment

Choose a reason for hiding this comment

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

LGTM assuming @cprice404 is good with it!

Copy link

@cprice404 cprice404 left a comment

Choose a reason for hiding this comment

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

yes

@anitarua anitarua merged commit 5ffea92 into main Dec 6, 2023
4 checks passed
@anitarua anitarua deleted the logger branch December 6, 2023 20:25
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.

3 participants