saasitone/pkg/log/log_test.go
Mike Stefanello 9acf73a4d9
Replace Echo logger with slog. (#67)
* Replace Echo logger with slog.
2024-06-14 21:01:48 -04:00

22 lines
376 B
Go

package log
import (
"testing"
"github.com/labstack/echo/v4"
"github.com/mikestefanello/pagoda/pkg/tests"
"github.com/stretchr/testify/assert"
)
func TestCtxSet(t *testing.T) {
ctx, _ := tests.NewContext(echo.New(), "/")
logger := Ctx(ctx)
assert.NotNil(t, logger)
logger = logger.With("a", "b")
Set(ctx, logger)
got := Ctx(ctx)
assert.Equal(t, got, logger)
}