MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / TestAttributes

Method TestAttributes

logger/formatter_json_test.go:106–138  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

104}
105
106func (s *FormatterJsonTestSuite) TestAttributes() {
107 s.logger().Info(
108 "Test message",
109 slog.String("string", "value"),
110 slog.Int("int", -100),
111 slog.Uint64("uint64", 200),
112 slog.Float64("float64", 3.14),
113 slog.Bool("bool", true),
114 slog.Time("timearg", time.Date(1984, 1, 2, 3, 4, 5, 6, time.UTC)),
115 slog.Duration("duration", time.Minute),
116 slog.Any("err", errors.New("error value")),
117 slog.Any("any", struct {
118 Field1 string
119 Field2 int
120 }{"value", 42}),
121 )
122
123 s.checkNextEntry(
124 "INFO",
125 map[string]any{
126 "msg": "Test message",
127 "string": "value",
128 "int": -100.0,
129 "uint64": 200.0,
130 "float64": 3.14,
131 "bool": true,
132 "timearg": "1984-01-02T03:04:05Z",
133 "duration": float64(time.Minute),
134 "err": "error value",
135 "any": map[string]any{"Field1": "value", "Field2": 42.0},
136 },
137 )
138}
139
140func (s *FormatterJsonTestSuite) TestGroups() {
141 s.Run("LastGroupNotEmpty", func() {

Callers

nothing calls this directly

Calls 3

checkNextEntryMethod · 0.95
IntMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected