rm risky panics

This commit is contained in:
Denis Bilenko 2024-12-09 14:24:30 +01:00
parent 207c5fd02a
commit 65b4f78331
1 changed files with 4 additions and 9 deletions

View File

@ -84,19 +84,14 @@ func initLogFlags(cmd *cobra.Command) *logFlags {
// Configure defaults from environment, if applicable.
// If the provided value is invalid it is ignored.
if v, ok := env.Lookup(cmd.Context(), envLogFile); ok {
if err := f.file.Set(v); err != nil {
panic(err)
}
// QQQ log the error? here and below
_ = f.file.Set(v)
}
if v, ok := env.Lookup(cmd.Context(), envLogLevel); ok {
if err := f.level.Set(v); err != nil {
panic(err)
}
_ = f.level.Set(v)
}
if v, ok := env.Lookup(cmd.Context(), envLogFormat); ok {
if err := f.output.Set(v); err != nil {
panic(err)
}
_ = f.output.Set(v)
}
flags := cmd.PersistentFlags()