log: fix docstring names (#28923)

This commit is contained in:
Daniel Liu 2024-11-15 10:02:42 +08:00
parent 966a03f297
commit fb25ddfa57
2 changed files with 4 additions and 3 deletions

View file

@ -192,7 +192,7 @@ func (h *GlogHandler) Handle(_ context.Context, r slog.Record) error {
frame, _ := fs.Next()
for _, rule := range h.patterns {
if rule.pattern.MatchString(fmt.Sprintf("%+s", frame.File)) {
if rule.pattern.MatchString(fmt.Sprintf("+%s", frame.File)) {
h.siteCache[r.PC], lvl, ok = rule.level, rule.level, true
}
}

View file

@ -2,6 +2,7 @@ package log
import (
"bytes"
"errors"
"fmt"
"io"
"math/big"
@ -77,7 +78,7 @@ func benchmarkLogger(b *testing.B, l Logger) {
tt = time.Now()
bigint = big.NewInt(100)
nilbig *big.Int
err = fmt.Errorf("Oh nooes it's crap")
err = errors.New("Oh nooes it's crap")
)
b.ReportAllocs()
b.ResetTimer()
@ -106,7 +107,7 @@ func TestLoggerOutput(t *testing.T) {
tt = time.Time{}
bigint = big.NewInt(100)
nilbig *big.Int
err = fmt.Errorf("Oh nooes it's crap")
err = errors.New("Oh nooes it's crap")
smallUint = uint256.NewInt(500_000)
bigUint = &uint256.Int{0xff, 0xff, 0xff, 0xff}
)