Merge branch 'main' of github.com:mikestefanello/pagoda into lite
This commit is contained in:
commit
0d2ad6e936
1 changed files with 2 additions and 2 deletions
|
|
@ -77,7 +77,7 @@ func TestLogRequest(t *testing.T) {
|
||||||
h := new(mockLogHandler)
|
h := new(mockLogHandler)
|
||||||
|
|
||||||
exec := func() {
|
exec := func() {
|
||||||
ctx, _ := tests.NewContext(c.Web, "http://test.localhost/abc?d=1")
|
ctx, _ := tests.NewContext(c.Web, "http://test.localhost/abc?d=1&e=2")
|
||||||
logger := slog.New(h).With("previous", "param")
|
logger := slog.New(h).With("previous", "param")
|
||||||
log.Set(ctx, logger)
|
log.Set(ctx, logger)
|
||||||
ctx.Request().Header.Set("Referer", "ref.com")
|
ctx.Request().Header.Set("Referer", "ref.com")
|
||||||
|
|
@ -101,7 +101,7 @@ func TestLogRequest(t *testing.T) {
|
||||||
assert.Equal(t, "5", h.GetAttr("bytes_out"))
|
assert.Equal(t, "5", h.GetAttr("bytes_out"))
|
||||||
assert.NotEmpty(t, h.GetAttr("latency"))
|
assert.NotEmpty(t, h.GetAttr("latency"))
|
||||||
assert.Equal(t, "INFO", h.level)
|
assert.Equal(t, "INFO", h.level)
|
||||||
assert.Equal(t, "GET /abc?d=1", h.msg)
|
assert.Equal(t, "GET /abc?d=1&e=2", h.msg)
|
||||||
|
|
||||||
statusCode = 500
|
statusCode = 500
|
||||||
exec()
|
exec()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue