MCPcopy
hub / github.com/tinyauthapp/tinyauth / TestNewLogger

Function TestNewLogger

internal/utils/tlog/log_wrapper_test.go:15–32  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

13)
14
15func TestNewLogger(t *testing.T) {
16 cfg := config.LogConfig{
17 Level: "debug",
18 Json: true,
19 Streams: config.LogStreams{
20 HTTP: config.LogStreamConfig{Enabled: true, Level: "info"},
21 App: config.LogStreamConfig{Enabled: true, Level: ""},
22 Audit: config.LogStreamConfig{Enabled: false, Level: ""},
23 },
24 }
25
26 logger := tlog.NewLogger(cfg)
27
28 assert.Assert(t, logger != nil)
29 assert.Assert(t, logger.HTTP.GetLevel() == zerolog.InfoLevel)
30 assert.Assert(t, logger.App.GetLevel() == zerolog.DebugLevel)
31 assert.Assert(t, logger.Audit.GetLevel() == zerolog.Disabled)
32}
33
34func TestNewSimpleLogger(t *testing.T) {
35 logger := tlog.NewSimpleLogger()

Callers

nothing calls this directly

Calls 1

NewLoggerFunction · 0.92

Tested by

no test coverage detected