-
Notifications
You must be signed in to change notification settings - Fork 280
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
Migrate to slog #3376
Migrate to slog #3376
Conversation
The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).
|
Big refactor just pushed up:
Core should use |
private/pkg/slogapp/slogapp.go
Outdated
|
||
// LoggerProvider is an appext.LoggerProvider for use with appext.BuilderWithLoggerProvider. | ||
func LoggerProvider(container appext.NameContainer, logLevel appext.LogLevel, logFormat appext.LogFormat) (*slog.Logger, error) { | ||
core, err := zapapp.NewCore(container.Stderr(), logLevel, logFormat) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor cleanup: this should call NewLogger
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
This uses the same
zapcore.Core
, so logging output is exactly the same for now - we rely on the log format for printing warnings in a certain way, and the log format as-is is nicer for CLI output anyways. We can look to change that out in the future.