[agent/codex:gpt-5.4-mini] Read ~/spec/code/core/go/log/RFC.md fully. Find ONE feature ... #17

Merged
Virgil merged 1 commit from agent/read---spec-code-core-go-log-rfc-md-full into dev 2026-04-01 05:08:53 +00:00
2 changed files with 4 additions and 4 deletions

2
log.go
View file

@ -489,7 +489,7 @@ func Security(msg string, keyvals ...any) {
func shouldRedact(key any, redactKeys []string) bool {
keyStr := fmt.Sprintf("%v", key)
for _, redactKey := range redactKeys {
if strings.EqualFold(redactKey, keyStr) {
if redactKey == keyStr {
return true
}
}

View file

@ -170,7 +170,7 @@ func TestLogger_Redaction_Good(t *testing.T) {
}
}
func TestLogger_Redaction_Good_CaseInsensitiveKeys(t *testing.T) {
func TestLogger_Redaction_Bad_CaseMismatchNotRedacted(t *testing.T) {
var buf bytes.Buffer
l := New(Options{
Level: LevelInfo,
@ -181,8 +181,8 @@ func TestLogger_Redaction_Good_CaseInsensitiveKeys(t *testing.T) {
l.Info("login", "PASSWORD", "secret123")
output := buf.String()
if !strings.Contains(output, "PASSWORD=\"[REDACTED]\"") {
t.Errorf("expected case-insensitive redaction, got %q", output)
if !strings.Contains(output, "PASSWORD=\"secret123\"") {
t.Errorf("expected case-mismatched key to remain visible, got %q", output)
}
}