fix(logging): match log levels case-sensitively

This commit is contained in:
2026-07-23 00:15:21 +04:00
parent 07e9287c39
commit f4d13d83aa
+4 -3
View File
@@ -34,13 +34,14 @@ type runtimeLog struct {
type runtimeLogger func(level runtimeLogLevel, text string)
// SplitLogLevels parses a comma-separated log-level string into a normalized,
// deduplicated slice of level tokens (lowercased and trimmed, empties dropped).
// SplitLogLevels parses a comma-separated log-level string into a deduplicated
// slice of level tokens (surrounding whitespace trimmed, empties dropped). Level
// names are matched case-sensitively, like the other enum options.
func SplitLogLevels(levels string) []string {
var out []string
seen := make(map[string]bool)
for part := range strings.SplitSeq(levels, ",") {
token := strings.ToLower(strings.TrimSpace(part))
token := strings.TrimSpace(part)
if token == "" || seen[token] {
continue
}