cmd/geth: more tests of log output

This commit is contained in:
Martin Holst Swende 2023-10-18 14:27:43 +02:00
parent c90857a6cb
commit a35dc2e144
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0
3 changed files with 56 additions and 44 deletions

View file

@ -78,5 +78,10 @@ func logTest(ctx *cli.Context) error {
{ // Lazy eval { // Lazy eval
log.Info("Lazy evaluation of value", "key", log.Lazy{Fn: func() interface{} { return "lazy value" }}) 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 return nil
} }

View file

@ -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: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: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: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: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: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: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: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: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: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: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: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:10:59+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:10:59+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: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: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: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: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:10:59+0200 lvl=info msg=uint64 1,000,000=1,000,000 t=2023-10-18T14:27:14+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: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:10:59+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 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:27:14+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:27:14+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:27:14+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:27:14+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:27:14+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:27:14+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:27:14+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:27:14+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="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"

View file

@ -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:26:57.326] 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:26:57.326] -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: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: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: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:11:31.106] uint256 111,222,333,444,555,678,999=111,222,333,444,555,678,999 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:11:31.106] uint256 11,122,233,344,455,567,899,900=11,122,233,344,455,567,899,900 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:11:31.106] 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:11:31.106] 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:11:31.106] 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,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:26:57.326] 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:26:57.326] 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:26:57.326] 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:26:57.326] 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:26:57.326] Special chars in key "special \n\t chars"=value
INFO [10-18|14:11:31.106] nospace nospace=nospace INFO [10-18|14:26:57.326] nospace nospace=nospace
INFO [10-18|14:11:31.106] with space "with nospace"="with nospace" INFO [10-18|14:26:57.326] 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:26:57.326] 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:26:57.326] 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:26:57.326] "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:26:57.326] "\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:26:57.326] 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] 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