Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all: replace log15 with slog #28187

Merged
merged 55 commits into from Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
9282464
all: replace log15 with slog
jwasinger Nov 7, 2023
0d145d2
add back code mistakenly removed in rebase
jwasinger Nov 7, 2023
7045f6e
address feedback: make diff smaller by adding backward-compatible log…
jwasinger Nov 7, 2023
dfea5f3
don't add comma's in logfmt formatted big.Int and uint256.Int
jwasinger Nov 8, 2023
3419543
formatting fix. error->eror
jwasinger Nov 8, 2023
db47dab
remove extra space
jwasinger Nov 8, 2023
5e3efdd
remove space. add back log.debug, log.backtrace flags with deprecati…
jwasinger Nov 8, 2023
46b65e2
remove extra spaces. add test for nil big.Int/uint256.Int. move log…
jwasinger Nov 8, 2023
fe625b8
cmd/utils: make deprecated logflags properly deprecated
holiman Nov 8, 2023
a59f254
remove unused LogfmtFormat
jwasinger Nov 8, 2023
3e11e89
remove builtinHandler
jwasinger Nov 9, 2023
bd684ce
Update log/handler.go
jwasinger Nov 9, 2023
dad6ef0
use log package JSONHandler wrapper
jwasinger Nov 9, 2023
14bc27f
pass handler attrs to TerminalFormat as a parameter instead of adding…
jwasinger Nov 9, 2023
5beed9f
add missing parts from previous commit
jwasinger Nov 9, 2023
32a47ad
move fieldPadding logic into terminalHandler. make TerminalFormat pr…
jwasinger Nov 10, 2023
a4f9996
remove FuncHandler
jwasinger Nov 10, 2023
3ab42db
re-add testlogger. add minimal adaption/copy of TerminalHandler form…
jwasinger Nov 13, 2023
8632783
cmd/geth: in logtest command, reset root logger before starting test …
jwasinger Nov 13, 2023
5021013
internal/testlog: reduce code a bit
holiman Nov 13, 2023
8a9e7d5
deps: update golang.org/x/exp to avoid panic in slog
holiman Nov 13, 2023
b61bbbf
log, debug: make terminal handler public, change how to reset fieldpa…
holiman Nov 13, 2023
655e6fc
fix logfmt time field value formatting
jwasinger Nov 14, 2023
d960dc8
express built-in time key as String attribute instead of Any
jwasinger Nov 14, 2023
c5cd6fe
format nil big.Int values as 'nil' instead of '<nil>'
jwasinger Nov 14, 2023
9f616ad
internal/debug: make sure non-terminal output is closed (whether fil…
jwasinger Nov 14, 2023
de3c7fb
log: remove formatShared.
jwasinger Nov 14, 2023
c9dc6d7
log: fix terminal format
holiman Nov 14, 2023
8ccc4eb
internal/debug: rename logOutputF -> logOutputFile. use io.WriteCloser
jwasinger Nov 15, 2023
813b1e9
fix build.
jwasinger Nov 15, 2023
e25cb5c
log: copy siteCache map when instantiating GlogHandler via WithAttrs …
jwasinger Nov 15, 2023
3b7e759
... and copy patterns too
jwasinger Nov 15, 2023
cdde508
FormatLogfmtValue should escape error and fmt.Stringer values
jwasinger Nov 15, 2023
a86ccc4
simplify TerminalHandler constructor/WithAttrs by omitting explicit i…
jwasinger Nov 15, 2023
a6198da
make big.Int/uint256.Int nil value be formatted as 'nil', not '<nil>'
jwasinger Nov 15, 2023
e76d989
update test data
jwasinger Nov 16, 2023
49ef852
ensure log tests contain time format
jwasinger Nov 16, 2023
e897630
log: move more instances of 'nil' to '<nil>'
jwasinger Nov 16, 2023
3ee1960
testdata/logging: update testdata again
jwasinger Nov 16, 2023
a110d6a
use separate time formats for logfmt/json handlers
jwasinger Nov 17, 2023
73d9e7c
update json testdata
jwasinger Nov 17, 2023
ec2e836
remove outdated code from logger
jwasinger Nov 20, 2023
9816631
internal/testlog, log: add Inner method to log.Logger to expose wrap…
jwasinger Nov 21, 2023
eb04be1
add Write method to Logger interface to allow expressing all operatio…
jwasinger Nov 22, 2023
e411480
don't stack-overflow
jwasinger Nov 22, 2023
31dcb3d
fix fmt.Stringer values in json handler
jwasinger Nov 22, 2023
0031beb
reinstate use of atomic.Value for holding root logger object
jwasinger Nov 22, 2023
a57ab1c
update json test data
jwasinger Nov 22, 2023
5b0252b
Update log/root.go
jwasinger Nov 22, 2023
77b6db7
Merge branch 'master' into slog
holiman Nov 22, 2023
6ba58e9
remove Inner method from Logger interface
jwasinger Nov 22, 2023
3bbf80f
cmd/geth: add json logging test
holiman Nov 23, 2023
f7cbc4e
Merge remote-tracking branch 'upstream/master' into HEAD
jwasinger Nov 27, 2023
a3738de
fix syntax error from merge
jwasinger Nov 27, 2023
38926cc
appease linter
jwasinger Nov 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/abigen/main.go
Expand Up @@ -232,7 +232,7 @@ func abigen(c *cli.Context) error {
}

func main() {
log.Root().SetHandler(log.LvlFilterHandler(log.LvlInfo, log.StreamHandler(os.Stderr, log.TerminalFormat(true))))
log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelInfo, true)))

if err := app.Run(os.Args); err != nil {
fmt.Fprintln(os.Stderr, err)
Expand Down
7 changes: 4 additions & 3 deletions cmd/bootnode/main.go
Expand Up @@ -32,6 +32,7 @@ import (
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/p2p/nat"
"github.com/ethereum/go-ethereum/p2p/netutil"
"golang.org/x/exp/slog"
)

func main() {
Expand All @@ -52,10 +53,10 @@ func main() {
)
flag.Parse()

glogger := log.NewGlogHandler(log.StreamHandler(os.Stderr, log.TerminalFormat(false)))
glogger.Verbosity(log.Lvl(*verbosity))
glogger := log.NewGlogHandler(log.NewTerminalHandler(os.Stderr, false))
glogger.Verbosity(slog.Level(*verbosity))
glogger.Vmodule(*vmodule)
log.Root().SetHandler(glogger)
log.SetDefault(log.NewLogger(glogger))

natm, err := nat.Parse(*natdesc)
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion cmd/clef/main.go
Expand Up @@ -57,6 +57,7 @@ import (
"github.com/mattn/go-colorable"
"github.com/mattn/go-isatty"
"github.com/urfave/cli/v2"
"golang.org/x/exp/slog"
)

const legalWarning = `
Expand Down Expand Up @@ -492,7 +493,7 @@ func initialize(c *cli.Context) error {
if usecolor {
output = colorable.NewColorable(logOutput)
}
log.Root().SetHandler(log.LvlFilterHandler(log.Lvl(c.Int(logLevelFlag.Name)), log.StreamHandler(output, log.TerminalFormat(usecolor))))
log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(output, slog.Level(c.Int(logLevelFlag.Name)), usecolor)))

return nil
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/devp2p/runtest.go
Expand Up @@ -54,7 +54,7 @@ func runTests(ctx *cli.Context, tests []utesting.Test) error {
}
// Disable logging unless explicitly enabled.
if !ctx.IsSet("verbosity") && !ctx.IsSet("vmodule") {
log.Root().SetHandler(log.DiscardHandler())
log.SetDefault(log.NewLogger(log.DiscardHandler()))
}
// Run the tests.
var run = utesting.RunTests
Expand Down
7 changes: 4 additions & 3 deletions cmd/evm/internal/t8ntool/block.go
Expand Up @@ -33,6 +33,7 @@ import (
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rlp"
"github.com/urfave/cli/v2"
"golang.org/x/exp/slog"
)

//go:generate go run github.com/fjl/gencodec -type header -field-override headerMarshaling -out gen_header.go
Expand Down Expand Up @@ -216,9 +217,9 @@ func (i *bbInput) sealClique(block *types.Block) (*types.Block, error) {
// BuildBlock constructs a block from the given inputs.
func BuildBlock(ctx *cli.Context) error {
// Configure the go-ethereum logger
glogger := log.NewGlogHandler(log.StreamHandler(os.Stderr, log.TerminalFormat(false)))
glogger.Verbosity(log.Lvl(ctx.Int(VerbosityFlag.Name)))
log.Root().SetHandler(glogger)
glogger := log.NewGlogHandler(log.NewTerminalHandler(os.Stderr, false))
glogger.Verbosity(slog.Level(ctx.Int(VerbosityFlag.Name)))
log.SetDefault(log.NewLogger(glogger))

baseDir, err := createBasedir(ctx)
if err != nil {
Expand Down
7 changes: 4 additions & 3 deletions cmd/evm/internal/t8ntool/transaction.go
Expand Up @@ -33,6 +33,7 @@ import (
"github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/tests"
"github.com/urfave/cli/v2"
"golang.org/x/exp/slog"
)

type result struct {
Expand Down Expand Up @@ -66,9 +67,9 @@ func (r *result) MarshalJSON() ([]byte, error) {

func Transaction(ctx *cli.Context) error {
// Configure the go-ethereum logger
glogger := log.NewGlogHandler(log.StreamHandler(os.Stderr, log.TerminalFormat(false)))
glogger.Verbosity(log.Lvl(ctx.Int(VerbosityFlag.Name)))
log.Root().SetHandler(glogger)
glogger := log.NewGlogHandler(log.NewTerminalHandler(os.Stderr, false))
glogger.Verbosity(slog.Level(ctx.Int(VerbosityFlag.Name)))
log.SetDefault(log.NewLogger(glogger))

var (
err error
Expand Down
8 changes: 5 additions & 3 deletions cmd/evm/internal/t8ntool/transition.go
Expand Up @@ -24,6 +24,8 @@ import (
"os"
"path"

"golang.org/x/exp/slog"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/consensus/misc/eip1559"
Expand Down Expand Up @@ -81,9 +83,9 @@ type input struct {

func Transition(ctx *cli.Context) error {
// Configure the go-ethereum logger
glogger := log.NewGlogHandler(log.StreamHandler(os.Stderr, log.TerminalFormat(false)))
glogger.Verbosity(log.Lvl(ctx.Int(VerbosityFlag.Name)))
log.Root().SetHandler(glogger)
glogger := log.NewGlogHandler(log.NewTerminalHandler(os.Stderr, false))
glogger.Verbosity(slog.Level(ctx.Int(VerbosityFlag.Name)))
log.SetDefault(log.NewLogger(glogger))

var (
err error
Expand Down
3 changes: 2 additions & 1 deletion cmd/faucet/faucet.go
Expand Up @@ -58,6 +58,7 @@ import (
"github.com/ethereum/go-ethereum/p2p/nat"
"github.com/ethereum/go-ethereum/params"
"github.com/gorilla/websocket"
"golang.org/x/exp/slog"
)

var (
Expand Down Expand Up @@ -99,7 +100,7 @@ var websiteTmpl string
func main() {
// Parse the flags and set up the logger to print everything requested
flag.Parse()
log.Root().SetHandler(log.LvlFilterHandler(log.Lvl(*logFlag), log.StreamHandler(os.Stderr, log.TerminalFormat(true))))
log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, slog.Level(*logFlag), true)))

// Construct the payout tiers
amounts := make([]string, *tiersFlag)
Expand Down
5 changes: 4 additions & 1 deletion cmd/geth/logtestcmd_active.go
Expand Up @@ -26,6 +26,7 @@ import (
"time"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/internal/debug"
"github.com/ethereum/go-ethereum/log"
"github.com/holiman/uint256"
"github.com/urfave/cli/v2"
Expand All @@ -49,7 +50,9 @@ func (c customQuotedStringer) String() string {
// logTest is an entry point which spits out some logs. This is used by testing
// to verify expected outputs
func logTest(ctx *cli.Context) error {
log.ResetGlobalState()
jwasinger marked this conversation as resolved.
Show resolved Hide resolved
// clear field padding map
debug.ResetLogging()

{ // big.Int
ba, _ := new(big.Int).SetString("111222333444555678999", 10) // "111,222,333,444,555,678,999"
bb, _ := new(big.Int).SetString("-111222333444555678999", 10) // "-111,222,333,444,555,678,999"
Expand Down
2 changes: 2 additions & 0 deletions cmd/geth/main.go
Expand Up @@ -144,6 +144,8 @@ var (
utils.GpoMaxGasPriceFlag,
utils.GpoIgnoreGasPriceFlag,
configFileFlag,
utils.LogDebugFlag,
utils.LogBacktraceAtFlag,
}, utils.NetworkFlags, utils.DatabaseFlags)

rpcFlags = []cli.Flag{
Expand Down
100 changes: 51 additions & 49 deletions cmd/geth/testdata/logging/logtest-json.txt
@@ -1,49 +1,51 @@
{"111,222,333,444,555,678,999":"111222333444555678999","lvl":"info","msg":"big.Int","t":"2023-11-09T08:33:19.464383209+01:00"}
{"-111,222,333,444,555,678,999":"-111222333444555678999","lvl":"info","msg":"-big.Int","t":"2023-11-09T08:33:19.46455928+01:00"}
{"11,122,233,344,455,567,899,900":"11122233344455567899900","lvl":"info","msg":"big.Int","t":"2023-11-09T08:33:19.464582073+01:00"}
{"-11,122,233,344,455,567,899,900":"-11122233344455567899900","lvl":"info","msg":"-big.Int","t":"2023-11-09T08:33:19.464594846+01:00"}
{"111,222,333,444,555,678,999":"0x607851afc94ca2517","lvl":"info","msg":"uint256","t":"2023-11-09T08:33:19.464607873+01:00"}
{"11,122,233,344,455,567,899,900":"0x25aeffe8aaa1ef67cfc","lvl":"info","msg":"uint256","t":"2023-11-09T08:33:19.464694639+01:00"}
{"1,000,000":1000000,"lvl":"info","msg":"int64","t":"2023-11-09T08:33:19.464708835+01:00"}
{"-1,000,000":-1000000,"lvl":"info","msg":"int64","t":"2023-11-09T08:33:19.464725054+01:00"}
{"9,223,372,036,854,775,807":9223372036854775807,"lvl":"info","msg":"int64","t":"2023-11-09T08:33:19.464735773+01:00"}
{"-9,223,372,036,854,775,808":-9223372036854775808,"lvl":"info","msg":"int64","t":"2023-11-09T08:33:19.464744532+01:00"}
{"1,000,000":1000000,"lvl":"info","msg":"uint64","t":"2023-11-09T08:33:19.464752807+01:00"}
{"18,446,744,073,709,551,615":18446744073709551615,"lvl":"info","msg":"uint64","t":"2023-11-09T08:33:19.464779296+01:00"}
{"key":"special \r\n\t chars","lvl":"info","msg":"Special chars in value","t":"2023-11-09T08:33:19.464794181+01:00"}
{"lvl":"info","msg":"Special chars in key","special \n\t chars":"value","t":"2023-11-09T08:33:19.464827197+01:00"}
{"lvl":"info","msg":"nospace","nospace":"nospace","t":"2023-11-09T08:33:19.464841118+01:00"}
{"lvl":"info","msg":"with space","t":"2023-11-09T08:33:19.464862818+01:00","with nospace":"with nospace"}
{"key":"\u001b[1G\u001b[K\u001b[1A","lvl":"info","msg":"Bash escapes in value","t":"2023-11-09T08:33:19.464876802+01:00"}
{"\u001b[1G\u001b[K\u001b[1A":"value","lvl":"info","msg":"Bash escapes in key","t":"2023-11-09T08:33:19.464885416+01:00"}
{"key":"value","lvl":"info","msg":"Bash escapes in message \u001b[1G\u001b[K\u001b[1A end","t":"2023-11-09T08:33:19.464906946+01:00"}
{"\u001b[35mColored\u001b[0m[":"\u001b[35mColored\u001b[0m[","lvl":"info","msg":"\u001b[35mColored\u001b[0m[","t":"2023-11-09T08:33:19.464921455+01:00"}
{"2562047h47m16.854s":"2562047h47m16.854s","lvl":"info","msg":"Custom Stringer value","t":"2023-11-09T08:33:19.464943893+01:00"}
{"key":"lazy value","lvl":"info","msg":"Lazy evaluation of value","t":"2023-11-09T08:33:19.465013552+01:00"}
{"lvl":"info","msg":"A message with wonky 💩 characters","t":"2023-11-09T08:33:19.465069437+01:00"}
{"lvl":"info","msg":"A multiline message \nINFO [10-18|14:11:31.106] with wonky characters 💩","t":"2023-11-09T08:33:19.465083053+01:00"}
{"lvl":"info","msg":"A multiline message \nLALA [ZZZZZZZZZZZZZZZZZZ] Actually part of message above","t":"2023-11-09T08:33:19.465104289+01:00"}
{"false":"false","lvl":"info","msg":"boolean","t":"2023-11-09T08:33:19.465117185+01:00","true":"true"}
{"foo":"beta","lvl":"info","msg":"repeated-key 1","t":"2023-11-09T08:33:19.465143425+01:00"}
{"lvl":"info","msg":"repeated-key 2","t":"2023-11-09T08:33:19.465156323+01:00","xx":"longer"}
{"lvl":"info","msg":"log at level info","t":"2023-11-09T08:33:19.465193158+01:00"}
{"lvl":"warn","msg":"log at level warn","t":"2023-11-09T08:33:19.465228964+01:00"}
{"lvl":"eror","msg":"log at level error","t":"2023-11-09T08:33:19.465240352+01:00"}
{"a":"aligned left","bar":"short","lvl":"info","msg":"test","t":"2023-11-09T08:33:19.465247226+01:00"}
{"a":1,"bar":"a long message","lvl":"info","msg":"test","t":"2023-11-09T08:33:19.465269028+01:00"}
{"a":"aligned right","bar":"short","lvl":"info","msg":"test","t":"2023-11-09T08:33:19.465313611+01:00"}
{"lvl":"info","msg":"The following logs should align so that the key-fields make 5 columns","t":"2023-11-09T08:33:19.465328188+01:00"}
{"gas":1123123,"hash":"0x0000000000000000000000000000000000000000000000000000000000001234","lvl":"info","msg":"Inserted known block","number":1012,"other":"first","t":"2023-11-09T08:33:19.465350507+01:00","txs":200}
{"gas":1123,"hash":"0x0000000000000000000000000000000000000000000000000000000000001235","lvl":"info","msg":"Inserted new block","number":1,"other":"second","t":"2023-11-09T08:33:19.465387952+01:00","txs":2}
{"gas":1,"hash":"0x0000000000000000000000000000000000000000000000000000000000012322","lvl":"info","msg":"Inserted known block","number":99,"other":"third","t":"2023-11-09T08:33:19.465406687+01:00","txs":10}
{"gas":99,"hash":"0x0000000000000000000000000000000000000000000000000000000000001234","lvl":"warn","msg":"Inserted known block","number":1012,"other":"fourth","t":"2023-11-09T08:33:19.465433025+01:00","txs":200}
{"\u003cnil\u003e":"\u003cnil\u003e","lvl":"info","msg":"(*big.Int)(nil)","t":"2023-11-09T08:33:19.465450283+01:00"}
{"\u003cnil\u003e":"nil","lvl":"info","msg":"(*uint256.Int)(nil)","t":"2023-11-09T08:33:19.465472953+01:00"}
{"lvl":"info","msg":"(fmt.Stringer)(nil)","res":"\u003cnil\u003e","t":"2023-11-09T08:33:19.465538633+01:00"}
{"lvl":"info","msg":"nil-concrete-stringer","res":"nil","t":"2023-11-09T08:33:19.465552355+01:00"}
{"lvl":"info","msg":"error(nil) ","res":"\u003cnil\u003e","t":"2023-11-09T08:33:19.465601029+01:00"}
{"lvl":"info","msg":"nil-concrete-error","res":"","t":"2023-11-09T08:33:19.46561622+01:00"}
{"lvl":"info","msg":"nil-custom-struct","res":"\u003cnil\u003e","t":"2023-11-09T08:33:19.465638888+01:00"}
{"lvl":"info","msg":"raw nil","res":"\u003cnil\u003e","t":"2023-11-09T08:33:19.465673664+01:00"}
{"lvl":"info","msg":"(*uint64)(nil)","res":"\u003cnil\u003e","t":"2023-11-09T08:33:19.465700264+01:00"}
{"level":"level","lvl":"lvl","msg":"msg","t":"t","time":"time"}
{"t":"2023-11-17T18:01:47.985514+08:00","lvl":"info","msg":"big.Int","111,222,333,444,555,678,999":"111222333444555678999"}
{"t":"2023-11-17T18:01:47.985653+08:00","lvl":"info","msg":"-big.Int","-111,222,333,444,555,678,999":"-111222333444555678999"}
{"t":"2023-11-17T18:01:47.985658+08:00","lvl":"info","msg":"big.Int","11,122,233,344,455,567,899,900":"11122233344455567899900"}
{"t":"2023-11-17T18:01:47.985662+08:00","lvl":"info","msg":"-big.Int","-11,122,233,344,455,567,899,900":"-11122233344455567899900"}
{"t":"2023-11-17T18:01:47.985681+08:00","lvl":"info","msg":"uint256","111,222,333,444,555,678,999":"111222333444555678999"}
{"t":"2023-11-17T18:01:47.985686+08:00","lvl":"info","msg":"uint256","11,122,233,344,455,567,899,900":"11122233344455567899900"}
{"t":"2023-11-17T18:01:47.985689+08:00","lvl":"info","msg":"int64","1,000,000":1000000}
{"t":"2023-11-17T18:01:47.985692+08:00","lvl":"info","msg":"int64","-1,000,000":-1000000}
{"t":"2023-11-17T18:01:47.985695+08:00","lvl":"info","msg":"int64","9,223,372,036,854,775,807":9223372036854775807}
{"t":"2023-11-17T18:01:47.985698+08:00","lvl":"info","msg":"int64","-9,223,372,036,854,775,808":-9223372036854775808}
{"t":"2023-11-17T18:01:47.9857+08:00","lvl":"info","msg":"uint64","1,000,000":1000000}
{"t":"2023-11-17T18:01:47.985703+08:00","lvl":"info","msg":"uint64","18,446,744,073,709,551,615":18446744073709551615}
{"t":"2023-11-17T18:01:47.985705+08:00","lvl":"info","msg":"Special chars in value","key":"special \r\n\t chars"}
{"t":"2023-11-17T18:01:47.985708+08:00","lvl":"info","msg":"Special chars in key","special \n\t chars":"value"}
{"t":"2023-11-17T18:01:47.985711+08:00","lvl":"info","msg":"nospace","nospace":"nospace"}
{"t":"2023-11-17T18:01:47.985714+08:00","lvl":"info","msg":"with space","with nospace":"with nospace"}
{"t":"2023-11-17T18:01:47.985717+08:00","lvl":"info","msg":"Bash escapes in value","key":"\u001b[1G\u001b[K\u001b[1A"}
{"t":"2023-11-17T18:01:47.98572+08:00","lvl":"info","msg":"Bash escapes in key","\u001b[1G\u001b[K\u001b[1A":"value"}
{"t":"2023-11-17T18:01:47.985722+08:00","lvl":"info","msg":"Bash escapes in message \u001b[1G\u001b[K\u001b[1A end","key":"value"}
{"t":"2023-11-17T18:01:47.985725+08:00","lvl":"info","msg":"\u001b[35mColored\u001b[0m[","\u001b[35mColored\u001b[0m[":"\u001b[35mColored\u001b[0m["}
{"t":"2023-11-17T18:01:47.985728+08:00","lvl":"info","msg":"an error message with quotes","error":"this is an 'error'"}
{"t":"2023-11-17T18:01:47.985732+08:00","lvl":"info","msg":"Custom Stringer value","2562047h47m16.854s":9223372036854775807}
{"t":"2023-11-17T18:01:47.986011+08:00","lvl":"info","msg":"a custom stringer that emits quoted text","output":{}}
{"t":"2023-11-17T18:01:47.986171+08:00","lvl":"info","msg":"Lazy evaluation of value","key":"lazy value"}
{"t":"2023-11-17T18:01:47.986174+08:00","lvl":"info","msg":"A message with wonky 💩 characters"}
{"t":"2023-11-17T18:01:47.986177+08:00","lvl":"info","msg":"A multiline message \nINFO [10-18|14:11:31.106] with wonky characters 💩"}
{"t":"2023-11-17T18:01:47.98618+08:00","lvl":"info","msg":"A multiline message \nLALA [ZZZZZZZZZZZZZZZZZZ] Actually part of message above"}
{"t":"2023-11-17T18:01:47.986182+08:00","lvl":"info","msg":"boolean","true":true,"false":false}
{"t":"2023-11-17T18:01:47.986185+08:00","lvl":"info","msg":"repeated-key 1","foo":"alpha","foo":"beta"}
{"t":"2023-11-17T18:01:47.986188+08:00","lvl":"info","msg":"repeated-key 2","xx":"short","xx":"longer"}
{"t":"2023-11-17T18:01:47.986191+08:00","lvl":"info","msg":"log at level info"}
{"t":"2023-11-17T18:01:47.986193+08:00","lvl":"warn","msg":"log at level warn"}
{"t":"2023-11-17T18:01:47.986196+08:00","lvl":"eror","msg":"log at level error"}
{"t":"2023-11-17T18:01:47.986198+08:00","lvl":"info","msg":"test","bar":"short","a":"aligned left"}
{"t":"2023-11-17T18:01:47.986201+08:00","lvl":"info","msg":"test","bar":"a long message","a":1}
{"t":"2023-11-17T18:01:47.986204+08:00","lvl":"info","msg":"test","bar":"short","a":"aligned right"}
{"t":"2023-11-17T18:01:47.986206+08:00","lvl":"info","msg":"The following logs should align so that the key-fields make 5 columns"}
{"t":"2023-11-17T18:01:47.986218+08:00","lvl":"info","msg":"Inserted known block","number":1012,"hash":"0x0000000000000000000000000000000000000000000000000000000000001234","txs":200,"gas":1123123,"other":"first"}
{"t":"2023-11-17T18:01:47.986226+08:00","lvl":"info","msg":"Inserted new block","number":1,"hash":"0x0000000000000000000000000000000000000000000000000000000000001235","txs":2,"gas":1123,"other":"second"}
{"t":"2023-11-17T18:01:47.98623+08:00","lvl":"info","msg":"Inserted known block","number":99,"hash":"0x0000000000000000000000000000000000000000000000000000000000012322","txs":10,"gas":1,"other":"third"}
{"t":"2023-11-17T18:01:47.986234+08:00","lvl":"warn","msg":"Inserted known block","number":1012,"hash":"0x0000000000000000000000000000000000000000000000000000000000001234","txs":200,"gas":99,"other":"fourth"}
{"t":"2023-11-17T18:01:47.986237+08:00","lvl":"info","msg":"(*big.Int)(nil)","<nil>":"<nil>"}
{"t":"2023-11-17T18:01:47.98624+08:00","lvl":"info","msg":"(*uint256.Int)(nil)","<nil>":"<nil>"}
{"t":"2023-11-17T18:01:47.986243+08:00","lvl":"info","msg":"(fmt.Stringer)(nil)","res":null}
{"t":"2023-11-17T18:01:47.986246+08:00","lvl":"info","msg":"nil-concrete-stringer","res":null}
{"t":"2023-11-17T18:01:47.986252+08:00","lvl":"info","msg":"error(nil) ","res":null}
{"t":"2023-11-17T18:01:47.986255+08:00","lvl":"info","msg":"nil-concrete-error","res":""}
{"t":"2023-11-17T18:01:47.986258+08:00","lvl":"info","msg":"nil-custom-struct","res":null}
{"t":"2023-11-17T18:01:47.986268+08:00","lvl":"info","msg":"raw nil","res":null}
{"t":"2023-11-17T18:01:47.986271+08:00","lvl":"info","msg":"(*uint64)(nil)","res":null}
{"t":"2023-11-17T18:01:47.986274+08:00","lvl":"info","msg":"Using keys 't', 'lvl', 'time', 'level' and 'msg'","t":"t","time":"time","lvl":"lvl","level":"level","msg":"msg"}