Skip to content

chore(log): sync remaining log package files with upstream go-ethereum #2876

Open

Description

@gzliudan

Background

#2837 already made log/handler.go byte-identical to go-ethereum's log/handler.go at 409aaefac. The remaining files under log/ still carry pre-existing divergence from upstream on dev-upgrade. This ticket tracks porting them.

Divergence inventory (baseline: go-ethereum 409aaefac)

  • log/handler_glog.go — upstream rewrote it entirely: glogConfig + atomic.Pointer[glogConfig] + a sync.Map callsite cache, plus a glogWithAttrs wrapper type so child loggers follow later Verbosity/Vmodule changes on the parent. Our tree still has the old RWMutex + siteCache design, but already uses strings.SplitSeq (a newer idiom), so its lineage differs from 409aaefac. When porting, diff against the latest geth master, not only 409aaefac.
  • log/logger_test.go — upstream adds TestLoggingWithVmoduleDowngrade and TestWithAttrsVerbosityChange, plus a small out → out.String() fix in TestJSONHandler.
  • log/format.go — upstream renames reflect.Ptr → reflect.Pointer in FormatSlogValue's recover path.
  • log/root.go — our tree has a local Enabled(level slog.Level) bool helper that upstream does not have; decide whether to keep it or align.

Approach

Same method as #2837: port file by file, verify with a byte-level diff against the matching upstream file, ship as an independent PR, and keep go test -count=1 ./log/... plus make all green.

Ref: #2837

Activity

  1. added 2 commits that reference this issue on Oct 26, 2026
    a5c695f
    0482577
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions