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 support for logging with context #231

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

whrss9527
Copy link

Add support for logging with context, you can pass slog to NewContextLogger to print trace or other log information.

#182

@whrss9527 whrss9527 requested a review from a team as a code owner June 20, 2024 08:23
Copy link

hashicorp-cla-app bot commented Jun 20, 2024

CLA assistant check
All committers have signed the CLA.

client.go Outdated Show resolved Hide resolved
@whrss9527
Copy link
Author

I want to make the logging code as concise and brief as possible, while ensuring the API is user-friendly and compatible with mainstream Golang logging frameworks, such as the increasingly common slog. If you have a better implementation, I am open to learning.

Copy link

@Ehco1996 Ehco1996 left a comment

Choose a reason for hiding this comment

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

lgtm

ptal @manicminer

@whrss9527 whrss9527 requested a review from Ehco1996 July 11, 2024 06:20
@whrss9527
Copy link
Author

@Ehco1996 Sorry, I clicked by mistake

client.go Outdated Show resolved Hide resolved
client.go Outdated Show resolved Hide resolved
client.go Outdated Show resolved Hide resolved
client.go Outdated Show resolved Hide resolved
client.go Outdated Show resolved Hide resolved
Copy link

@reedip reedip left a comment

Choose a reason for hiding this comment

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

In line #445 in the new code, the comment states that the Custom Logger can be Logger or Leveled Logger. Maybe that can be changed?
This is just a nit, and mainly because I was trying to go through this Client structure and found it.

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.

4 participants