-
Notifications
You must be signed in to change notification settings - Fork 322
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
chore: log config init errors using exposed methods #4541
Conversation
Important Auto Review SkippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the To trigger a single review, invoke the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
path, err := config.Default.ConfigFileUsed() | ||
if err != nil { | ||
r.logger.Warnf("Config: Failed to parse config file from path %q, using default values: %v", path, err) | ||
} else { | ||
r.logger.Infof("Config: Using config file: %s", path) | ||
} | ||
|
||
if err := config.Default.DotEnvLoaded(); err != nil { | ||
r.logger.Infof("Config: No .env file loaded: %v", err) | ||
} else { | ||
r.logger.Infof("Config: Loaded .env file") | ||
} |
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.
path, err := config.Default.ConfigFileUsed() | |
if err != nil { | |
r.logger.Warnf("Config: Failed to parse config file from path %q, using default values: %v", path, err) | |
} else { | |
r.logger.Infof("Config: Using config file: %s", path) | |
} | |
if err := config.Default.DotEnvLoaded(); err != nil { | |
r.logger.Infof("Config: No .env file loaded: %v", err) | |
} else { | |
r.logger.Infof("Config: Loaded .env file") | |
} | |
path, err := config.Default.ConfigFileUsed() | |
if err != nil { | |
r.logger.Warnn("Config: Failed to parse config file, using default values", | |
logger.NewStringField("path", path), | |
obskit.Error(err), | |
) | |
} else { | |
r.logger.Infon("Config: Using config file", logger.NewStringField("path", path)) | |
} | |
if err := config.Default.DotEnvLoaded(); err != nil { | |
r.logger.Infon("Config: No .env file loaded", obskit.Error(err)) | |
} else { | |
r.logger.Infon("Config: Loaded .env file") | |
} |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4541 +/- ##
==========================================
- Coverage 74.24% 74.22% -0.03%
==========================================
Files 413 413
Lines 48371 48380 +9
==========================================
- Hits 35915 35909 -6
- Misses 10111 10122 +11
- Partials 2345 2349 +4 ☔ View full report in Codecov by Sentry. |
WARN: To be merge after rudder-go-kit change is merged and released.
Description
Related and depended on rudderlabs/rudder-go-kit#406
Config init error will no longer be logged but the library, rather two methods are exposed so they can be handled downstream.
This is how the output looks like now:
No errors:
With errors:
vs before:
Linear Ticket
https://linear.app/rudderstack/issue/PIPE-956/rudder-go-kit-config-init-error-logs
resolves PIPE-956
Security