Commit 761468ef authored by Adrian Sutton's avatar Adrian Sutton Committed by GitHub

Fix debug/trace logging support when not using console log format (#10146)

* log: Fix logfmt logger to support debug and trace logs

* op-geth: Pull in fix for json logger

* op-geth: Update to v1.101311.0
parent 66ae120d
......@@ -265,7 +265,7 @@ require (
rsc.io/tmplfunc v0.0.3 // indirect
)
replace github.com/ethereum/go-ethereum v1.13.11 => github.com/ethereum-optimism/op-geth v1.101311.0-rc.1
replace github.com/ethereum/go-ethereum v1.13.11 => github.com/ethereum-optimism/op-geth v1.101311.0
//replace github.com/ethereum/go-ethereum v1.13.9 => ../op-geth
......
......@@ -225,8 +225,8 @@ github.com/elastic/gosigar v0.14.2 h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/
github.com/elastic/gosigar v0.14.2/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs=
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 h1:RWHKLhCrQThMfch+QJ1Z8veEq5ZO3DfIhZ7xgRP9WTc=
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3/go.mod h1:QziizLAiF0KqyLdNJYD7O5cpDlaFMNZzlxYNcWsJUxs=
github.com/ethereum-optimism/op-geth v1.101311.0-rc.1 h1:3JE5FyGXNQCnXUuiK3I6ZD3zbB2DBIcEMsXCpjrXUwM=
github.com/ethereum-optimism/op-geth v1.101311.0-rc.1/go.mod h1:K23yb9efVf9DdUOv/vl/Ux57Tng00rLaFqWYlFF45CA=
github.com/ethereum-optimism/op-geth v1.101311.0 h1:n0e5WD9kEwuXb5prAO7b+2ctz/sLy6tlJ2qmbbPEi9Y=
github.com/ethereum-optimism/op-geth v1.101311.0/go.mod h1:K23yb9efVf9DdUOv/vl/Ux57Tng00rLaFqWYlFF45CA=
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240318114348-52d3dbd1605d h1:K7HdD/ZAcSFhcqqnUAbvU+8vsg0DzL8pvetHw5vRLCc=
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240318114348-52d3dbd1605d/go.mod h1:7xh2awFQqsiZxFrHKTgEd+InVfDRrkKVUIuK8SAFHp0=
github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY=
......
......@@ -128,6 +128,7 @@ func FormatHandler(ft FormatType, color bool) func(io.Writer) slog.Handler {
termColorHandler := func(w io.Writer) slog.Handler {
return log.NewTerminalHandler(w, color)
}
logfmtHandler := func(w io.Writer) slog.Handler { return log.LogfmtHandlerWithLevel(w, log.LevelTrace) }
switch ft {
case FormatJSON:
return log.JSONHandler
......@@ -135,12 +136,12 @@ func FormatHandler(ft FormatType, color bool) func(io.Writer) slog.Handler {
if term.IsTerminal(int(os.Stdout.Fd())) {
return termColorHandler
} else {
return log.LogfmtHandler
return logfmtHandler
}
case FormatTerminal:
return termColorHandler
case FormatLogFmt:
return log.LogfmtHandler
return logfmtHandler
default:
panic(fmt.Errorf("failed to create slog.Handler factory for format-type=%q and color=%v", ft, color))
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment