diff --git a/cmd/geth/logtestcmd.go b/cmd/geth/logtestcmd.go index 2cb3e05d58..d2da907462 100644 --- a/cmd/geth/logtestcmd.go +++ b/cmd/geth/logtestcmd.go @@ -78,5 +78,10 @@ func logTest(ctx *cli.Context) error { { // Lazy eval log.Info("Lazy evaluation of value", "key", log.Lazy{Fn: func() interface{} { return "lazy value" }}) } + { // Multi-line message + log.Info("A message with wonky \U0001F4A9 characters") + log.Info("A multiline message \nINFO [10-18|14:11:31.106] with wonky characters \U0001F4A9") + log.Info("A multiline message \nLALA [ZZZZZZZZZZZZZZZZZZ] Actually part of message above") + } return nil } diff --git a/cmd/geth/testdata/logging/logtest-logfmt.txt b/cmd/geth/testdata/logging/logtest-logfmt.txt index 4703ebd921..24673d1d38 100644 --- a/cmd/geth/testdata/logging/logtest-logfmt.txt +++ b/cmd/geth/testdata/logging/logtest-logfmt.txt @@ -1,22 +1,25 @@ -t=2023-10-18T14:10:59+0200 lvl=info msg=big.Int 111,222,333,444,555,678,999=111,222,333,444,555,678,999 -t=2023-10-18T14:10:59+0200 lvl=info msg=-big.Int -111,222,333,444,555,678,999=-111,222,333,444,555,678,999 -t=2023-10-18T14:10:59+0200 lvl=info msg=big.Int 11,122,233,344,455,567,899,900=11,122,233,344,455,567,899,900 -t=2023-10-18T14:10:59+0200 lvl=info msg=-big.Int -11,122,233,344,455,567,899,900=-11,122,233,344,455,567,899,900 -t=2023-10-18T14:10:59+0200 lvl=info msg=uint256 111,222,333,444,555,678,999=111,222,333,444,555,678,999 -t=2023-10-18T14:10:59+0200 lvl=info msg=uint256 11,122,233,344,455,567,899,900=11,122,233,344,455,567,899,900 -t=2023-10-18T14:10:59+0200 lvl=info msg=int64 1,000,000=1,000,000 -t=2023-10-18T14:10:59+0200 lvl=info msg=int64 -1,000,000=-1,000,000 -t=2023-10-18T14:10:59+0200 lvl=info msg=int64 9,223,372,036,854,775,807=9,223,372,036,854,775,807 -t=2023-10-18T14:10:59+0200 lvl=info msg=int64 -9,223,372,036,854,775,808=-9,223,372,036,854,775,808 -t=2023-10-18T14:10:59+0200 lvl=info msg=uint64 1,000,000=1,000,000 -t=2023-10-18T14:10:59+0200 lvl=info msg=uint64 18,446,744,073,709,551,615=18,446,744,073,709,551,615 -t=2023-10-18T14:10:59+0200 lvl=info msg="Special chars in value" key="special \r\n\t chars" -t=2023-10-18T14:10:59+0200 lvl=info msg="Special chars in key" "special \n\t chars"=value -t=2023-10-18T14:10:59+0200 lvl=info msg=nospace nospace=nospace -t=2023-10-18T14:10:59+0200 lvl=info msg="with space" "with nospace"="with nospace" -t=2023-10-18T14:10:59+0200 lvl=info msg="Bash escapes in value" key="\x1b[1G\x1b[K\x1b[1A" -t=2023-10-18T14:10:59+0200 lvl=info msg="Bash escapes in key" "\x1b[1G\x1b[K\x1b[1A"=value -t=2023-10-18T14:10:59+0200 lvl=info msg="Bash escapes in message \x1b[1G\x1b[K\x1b[1A end" key=value -t=2023-10-18T14:10:59+0200 lvl=info msg="\x1b[35mColored\x1b[0m[" "\x1b[35mColored\x1b[0m["="\x1b[35mColored\x1b[0m[" -t=2023-10-18T14:10:59+0200 lvl=info msg="Custom Stringer value" 2562047h47m16.854s=2562047h47m16.854s -t=2023-10-18T14:10:59+0200 lvl=info msg="Lazy evaluation of value" key="lazy value" +t=2023-10-18T14:27:14+0200 lvl=info msg=big.Int 111,222,333,444,555,678,999=111,222,333,444,555,678,999 +t=2023-10-18T14:27:14+0200 lvl=info msg=-big.Int -111,222,333,444,555,678,999=-111,222,333,444,555,678,999 +t=2023-10-18T14:27:14+0200 lvl=info msg=big.Int 11,122,233,344,455,567,899,900=11,122,233,344,455,567,899,900 +t=2023-10-18T14:27:14+0200 lvl=info msg=-big.Int -11,122,233,344,455,567,899,900=-11,122,233,344,455,567,899,900 +t=2023-10-18T14:27:14+0200 lvl=info msg=uint256 111,222,333,444,555,678,999=111,222,333,444,555,678,999 +t=2023-10-18T14:27:14+0200 lvl=info msg=uint256 11,122,233,344,455,567,899,900=11,122,233,344,455,567,899,900 +t=2023-10-18T14:27:14+0200 lvl=info msg=int64 1,000,000=1,000,000 +t=2023-10-18T14:27:14+0200 lvl=info msg=int64 -1,000,000=-1,000,000 +t=2023-10-18T14:27:14+0200 lvl=info msg=int64 9,223,372,036,854,775,807=9,223,372,036,854,775,807 +t=2023-10-18T14:27:14+0200 lvl=info msg=int64 -9,223,372,036,854,775,808=-9,223,372,036,854,775,808 +t=2023-10-18T14:27:14+0200 lvl=info msg=uint64 1,000,000=1,000,000 +t=2023-10-18T14:27:14+0200 lvl=info msg=uint64 18,446,744,073,709,551,615=18,446,744,073,709,551,615 +t=2023-10-18T14:27:14+0200 lvl=info msg="Special chars in value" key="special \r\n\t chars" +t=2023-10-18T14:27:14+0200 lvl=info msg="Special chars in key" "special \n\t chars"=value +t=2023-10-18T14:27:14+0200 lvl=info msg=nospace nospace=nospace +t=2023-10-18T14:27:14+0200 lvl=info msg="with space" "with nospace"="with nospace" +t=2023-10-18T14:27:14+0200 lvl=info msg="Bash escapes in value" key="\x1b[1G\x1b[K\x1b[1A" +t=2023-10-18T14:27:14+0200 lvl=info msg="Bash escapes in key" "\x1b[1G\x1b[K\x1b[1A"=value +t=2023-10-18T14:27:14+0200 lvl=info msg="Bash escapes in message \x1b[1G\x1b[K\x1b[1A end" key=value +t=2023-10-18T14:27:14+0200 lvl=info msg="\x1b[35mColored\x1b[0m[" "\x1b[35mColored\x1b[0m["="\x1b[35mColored\x1b[0m[" +t=2023-10-18T14:27:14+0200 lvl=info msg="Custom Stringer value" 2562047h47m16.854s=2562047h47m16.854s +t=2023-10-18T14:27:14+0200 lvl=info msg="Lazy evaluation of value" key="lazy value" +t=2023-10-18T14:27:14+0200 lvl=info msg="A message with wonky 💩 characters" +t=2023-10-18T14:27:14+0200 lvl=info msg="A multiline message \nINFO [10-18|14:11:31.106] with wonky characters 💩" +t=2023-10-18T14:27:14+0200 lvl=info msg="A multiline message \nLALA [ZZZZZZZZZZZZZZZZZZ] Actually part of message above" diff --git a/cmd/geth/testdata/logging/logtest-terminal.txt b/cmd/geth/testdata/logging/logtest-terminal.txt index 5618968788..923da2faeb 100644 --- a/cmd/geth/testdata/logging/logtest-terminal.txt +++ b/cmd/geth/testdata/logging/logtest-terminal.txt @@ -1,22 +1,26 @@ -INFO [10-18|14:11:31.106] big.Int 111,222,333,444,555,678,999=111,222,333,444,555,678,999 -INFO [10-18|14:11:31.106] -big.Int -111,222,333,444,555,678,999=-111,222,333,444,555,678,999 -INFO [10-18|14:11:31.106] big.Int 11,122,233,344,455,567,899,900=11,122,233,344,455,567,899,900 -INFO [10-18|14:11:31.106] -big.Int -11,122,233,344,455,567,899,900=-11,122,233,344,455,567,899,900 -INFO [10-18|14:11:31.106] uint256 111,222,333,444,555,678,999=111,222,333,444,555,678,999 -INFO [10-18|14:11:31.106] uint256 11,122,233,344,455,567,899,900=11,122,233,344,455,567,899,900 -INFO [10-18|14:11:31.106] int64 1,000,000=1,000,000 -INFO [10-18|14:11:31.106] int64 -1,000,000=-1,000,000 -INFO [10-18|14:11:31.106] int64 9,223,372,036,854,775,807=9,223,372,036,854,775,807 -INFO [10-18|14:11:31.106] int64 -9,223,372,036,854,775,808=-9,223,372,036,854,775,808 -INFO [10-18|14:11:31.106] uint64 1,000,000=1,000,000 -INFO [10-18|14:11:31.106] uint64 18,446,744,073,709,551,615=18,446,744,073,709,551,615 -INFO [10-18|14:11:31.106] Special chars in value key="special \r\n\t chars" -INFO [10-18|14:11:31.106] Special chars in key "special \n\t chars"=value -INFO [10-18|14:11:31.106] nospace nospace=nospace -INFO [10-18|14:11:31.106] with space "with nospace"="with nospace" -INFO [10-18|14:11:31.106] Bash escapes in value key="\x1b[1G\x1b[K\x1b[1A" -INFO [10-18|14:11:31.106] Bash escapes in key "\x1b[1G\x1b[K\x1b[1A"=value -INFO [10-18|14:11:31.106] "Bash escapes in message \x1b[1G\x1b[K\x1b[1A end" key=value -INFO [10-18|14:11:31.106] "\x1b[35mColored\x1b[0m[" "\x1b[35mColored\x1b[0m["="\x1b[35mColored\x1b[0m[" -INFO [10-18|14:11:31.106] Custom Stringer value 2562047h47m16.854s=2562047h47m16.854s -INFO [10-18|14:11:31.106] Lazy evaluation of value key="lazy value" +INFO [10-18|14:26:57.326] big.Int 111,222,333,444,555,678,999=111,222,333,444,555,678,999 +INFO [10-18|14:26:57.326] -big.Int -111,222,333,444,555,678,999=-111,222,333,444,555,678,999 +INFO [10-18|14:26:57.326] big.Int 11,122,233,344,455,567,899,900=11,122,233,344,455,567,899,900 +INFO [10-18|14:26:57.326] -big.Int -11,122,233,344,455,567,899,900=-11,122,233,344,455,567,899,900 +INFO [10-18|14:26:57.326] uint256 111,222,333,444,555,678,999=111,222,333,444,555,678,999 +INFO [10-18|14:26:57.326] uint256 11,122,233,344,455,567,899,900=11,122,233,344,455,567,899,900 +INFO [10-18|14:26:57.326] int64 1,000,000=1,000,000 +INFO [10-18|14:26:57.326] int64 -1,000,000=-1,000,000 +INFO [10-18|14:26:57.326] int64 9,223,372,036,854,775,807=9,223,372,036,854,775,807 +INFO [10-18|14:26:57.326] int64 -9,223,372,036,854,775,808=-9,223,372,036,854,775,808 +INFO [10-18|14:26:57.326] uint64 1,000,000=1,000,000 +INFO [10-18|14:26:57.326] uint64 18,446,744,073,709,551,615=18,446,744,073,709,551,615 +INFO [10-18|14:26:57.326] Special chars in value key="special \r\n\t chars" +INFO [10-18|14:26:57.326] Special chars in key "special \n\t chars"=value +INFO [10-18|14:26:57.326] nospace nospace=nospace +INFO [10-18|14:26:57.326] with space "with nospace"="with nospace" +INFO [10-18|14:26:57.326] Bash escapes in value key="\x1b[1G\x1b[K\x1b[1A" +INFO [10-18|14:26:57.326] Bash escapes in key "\x1b[1G\x1b[K\x1b[1A"=value +INFO [10-18|14:26:57.326] "Bash escapes in message \x1b[1G\x1b[K\x1b[1A end" key=value +INFO [10-18|14:26:57.326] "\x1b[35mColored\x1b[0m[" "\x1b[35mColored\x1b[0m["="\x1b[35mColored\x1b[0m[" +INFO [10-18|14:26:57.326] Custom Stringer value 2562047h47m16.854s=2562047h47m16.854s +INFO [10-18|14:26:57.326] Lazy evaluation of value key="lazy value" +INFO [10-18|14:26:57.326] "A message with wonky 💩 characters" +INFO [10-18|14:26:57.326] "A multiline message \nINFO [10-18|14:11:31.106] with wonky characters 💩" +INFO [10-18|14:26:57.326] A multiline message +LALA [ZZZZZZZZZZZZZZZZZZ] Actually part of message above