feat: support for disable mon logs like sqlx (#3606)

Co-authored-by: Kevin Wan <wanjunfeng@gmail.com>
This commit is contained in:
shenbaise9527
2023-10-22 23:00:02 +08:00
committed by GitHub
parent 6286941ebf
commit a242fec5e1
6 changed files with 222 additions and 47 deletions

View File

@@ -599,13 +599,11 @@ func TestDecoratedCollection_LogDuration(t *testing.T) {
errors.New("bar"), make(chan int))
assert.Contains(t, buf.String(), "foo")
assert.Contains(t, buf.String(), "bar")
assert.Contains(t, buf.String(), "slowcall")
buf.Reset()
c.logDuration(context.Background(), "foo", timex.Now()-slowThreshold.Load()*2,
errors.New("bar"))
assert.Contains(t, buf.String(), "foo")
assert.Contains(t, buf.String(), "slowcall")
buf.Reset()
c.logDuration(context.Background(), "foo", timex.Now()-slowThreshold.Load()*2, nil)