|
|
@ -97,7 +97,7 @@ func benchmarkLogger(b *testing.B, l Logger) { |
|
|
|
tt = time.Now() |
|
|
|
tt = time.Now() |
|
|
|
bigint = big.NewInt(100) |
|
|
|
bigint = big.NewInt(100) |
|
|
|
nilbig *big.Int |
|
|
|
nilbig *big.Int |
|
|
|
err = errors.New("Oh nooes it's crap") |
|
|
|
err = errors.New("oh nooes it's crap") |
|
|
|
) |
|
|
|
) |
|
|
|
b.ReportAllocs() |
|
|
|
b.ReportAllocs() |
|
|
|
b.ResetTimer() |
|
|
|
b.ResetTimer() |
|
|
@ -126,7 +126,7 @@ func TestLoggerOutput(t *testing.T) { |
|
|
|
tt = time.Time{} |
|
|
|
tt = time.Time{} |
|
|
|
bigint = big.NewInt(100) |
|
|
|
bigint = big.NewInt(100) |
|
|
|
nilbig *big.Int |
|
|
|
nilbig *big.Int |
|
|
|
err = errors.New("Oh nooes it's crap") |
|
|
|
err = errors.New("oh nooes it's crap") |
|
|
|
smallUint = uint256.NewInt(500_000) |
|
|
|
smallUint = uint256.NewInt(500_000) |
|
|
|
bigUint = &uint256.Int{0xff, 0xff, 0xff, 0xff} |
|
|
|
bigUint = &uint256.Int{0xff, 0xff, 0xff, 0xff} |
|
|
|
) |
|
|
|
) |
|
|
@ -150,7 +150,7 @@ func TestLoggerOutput(t *testing.T) { |
|
|
|
|
|
|
|
|
|
|
|
have := out.String() |
|
|
|
have := out.String() |
|
|
|
t.Logf("output %v", out.String()) |
|
|
|
t.Logf("output %v", out.String()) |
|
|
|
want := `INFO [11-07|19:14:33.821] This is a message foo=123 bytes="[0 0 0 0 0 0 0 0 0 0]" bonk="a string with text" time=0001-01-01T00:00:00+0000 bigint=100 nilbig=<nil> err="Oh nooes it's crap" struct="{A:Foo B:12}" struct="{A:Foo\nLinebreak B:122}" ptrstruct="&{A:Foo B:12}" smalluint=500,000 bigUint=1,600,660,942,523,603,594,864,898,306,482,794,244,293,965,082,972,225,630,372,095 |
|
|
|
want := `INFO [11-07|19:14:33.821] This is a message foo=123 bytes="[0 0 0 0 0 0 0 0 0 0]" bonk="a string with text" time=0001-01-01T00:00:00+0000 bigint=100 nilbig=<nil> err="oh nooes it's crap" struct="{A:Foo B:12}" struct="{A:Foo\nLinebreak B:122}" ptrstruct="&{A:Foo B:12}" smalluint=500,000 bigUint=1,600,660,942,523,603,594,864,898,306,482,794,244,293,965,082,972,225,630,372,095 |
|
|
|
` |
|
|
|
` |
|
|
|
if !bytes.Equal([]byte(have)[25:], []byte(want)[25:]) { |
|
|
|
if !bytes.Equal([]byte(have)[25:], []byte(want)[25:]) { |
|
|
|
t.Errorf("Error\nhave: %q\nwant: %q", have, want) |
|
|
|
t.Errorf("Error\nhave: %q\nwant: %q", have, want) |
|
|
|