MCPcopy
hub / github.com/labstack/echo / TestLogger

Function TestLogger

context_test.go:1500–1515  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1498}
1499
1500func TestLogger(t *testing.T) {
1501 e := New()
1502 c := e.NewContext(nil, nil)
1503
1504 log1 := c.Logger()
1505 assert.NotNil(t, log1)
1506 assert.Equal(t, e.Logger, log1)
1507
1508 customLogger := slog.New(slog.NewTextHandler(os.Stdout, nil))
1509 c.SetLogger(customLogger)
1510 assert.Equal(t, customLogger, c.Logger())
1511
1512 // Resetting the context returns the initial Echo logger
1513 c.Reset(nil, nil)
1514 assert.Equal(t, e.Logger, c.Logger())
1515}
1516
1517func TestRouteInfo(t *testing.T) {
1518 e := New()

Callers

nothing calls this directly

Calls 5

LoggerMethod · 0.95
SetLoggerMethod · 0.95
ResetMethod · 0.95
NewFunction · 0.85
NewContextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…