diff --git a/log/format.go b/log/format.go index fb9e3955ed..5cbbe3341e 100644 --- a/log/format.go +++ b/log/format.go @@ -126,12 +126,12 @@ func (h *TerminalHandler) logfmt(buf *bytes.Buffer, r slog.Record, color int) { // formatValue formats a value for serialization func FormatLogfmtValue(value interface{}, term bool) (result string) { if value == nil { - return "nil" + return "" } defer func() { if err := recover(); err != nil { if v := reflect.ValueOf(value); v.Kind() == reflect.Ptr && v.IsNil() { - result = "nil" + result = "" } else { panic(err) } @@ -149,7 +149,7 @@ func FormatLogfmtValue(value interface{}, term bool) (result string) { // Big ints get consumed by the Stringer clause, so we need to handle // them earlier on. if v == nil { - return "nil" + return "" } return formatLogfmtBigInt(v) @@ -157,7 +157,7 @@ func FormatLogfmtValue(value interface{}, term bool) (result string) { // Uint256s get consumed by the Stringer clause, so we need to handle // them earlier on. if v == nil { - return "nil" + return "" } return formatLogfmtUint256(v) } diff --git a/log/handler.go b/log/handler.go index 1f28f8c264..97f3224511 100644 --- a/log/handler.go +++ b/log/handler.go @@ -188,13 +188,13 @@ func builtinReplace(_ []string, attr slog.Attr) slog.Attr { attr = slog.Any(attr.Key, v.Format(timeFormat)) case *big.Int: if v == nil { - attr.Value = slog.StringValue("nil") + attr.Value = slog.StringValue("") } else { attr.Value = slog.StringValue(v.String()) } case *uint256.Int: if v == nil { - attr.Value = slog.StringValue("nil") + attr.Value = slog.StringValue("") } else { attr.Value = slog.StringValue(v.Dec()) }