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

add TraceLogConfig with customizable TimeKey and ensureConfig method for default initialization #2098

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

stringintech
Copy link
Contributor

Description

This PR introduces the TraceLogConfig struct to the tracelog package. The new struct includes a customizable TimeKey field with a default value of "time", allowing flexibility for logging configurations.

Additionally, the ensureConfig method is introduced to ensure that the Config field is initialized with default values if it is nil. Trace methods have been updated to call ensureConfig() to ensure that Config is properly initialized before logging.

References

This PR addresses the issue discussed in Issue #2043.

Feedback Request

Are there any additional key names or configurations that should be considered for inclusion in TraceLogConfig to further enhance customization?

I would appreciate any feedback on whether I am following the correct procedure. Thank you.

@jackc
Copy link
Owner

jackc commented Aug 3, 2024

LGTM.

Are there any additional key names or configurations that should be considered for inclusion in TraceLogConfig to further enhance customization?

I don't know of any.

@jackc jackc merged commit d6fc8b0 into jackc:master Aug 13, 2024
14 checks passed
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.

2 participants