Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions internal/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,12 @@ func HTTPClientWithRetry() *http.Client {
}

func CreateLogger(name string) *zap.Logger {
logLevel := os.Getenv("COG_LOG_LEVEL")
if logLevel == "" {
logLevel = "info"
logLevel := strings.ToUpper(os.Getenv("COG_LOG_LEVEL"))
switch logLevel {
case "WARNING":
logLevel = "WARN"
case "":
logLevel = "INFO"
}
Comment on lines +120 to 126
Copy link

Copilot AI Sep 12, 2025

Choose a reason for hiding this comment

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

The switch statement only handles uppercase values but converts all input to uppercase first. Consider adding a case for lowercase 'warning' or documenting that the ToUpper conversion handles case-insensitive matching.

Copilot uses AI. Check for mistakes.
lvl, err := zapcore.ParseLevel(logLevel)
if err != nil {
Expand Down
Loading