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

Method TestAttributes

logger/formatter_pretty_test.go:103–135  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

101}
102
103func (s *FormatterPrettyTestSuite) TestAttributes() {
104 s.logger().Info(
105 "Test message",
106 slog.String("string", "value"),
107 slog.Int("int", -100),
108 slog.Uint64("uint64", 200),
109 slog.Float64("float64", 3.14),
110 slog.Bool("bool", true),
111 slog.Time("time", time.Date(1984, 1, 2, 3, 4, 5, 6, time.UTC)),
112 slog.Duration("duration", time.Minute),
113 slog.Any("err", errors.New("error value")),
114 slog.Any("any", struct {
115 Field1 string
116 Field2 int
117 }{"value", 42}),
118 )
119
120 s.checkNextEntry(
121 "INF",
122 strings.Join([]string{
123 "Test message",
124 "string=value",
125 "int=-100",
126 "uint64=200",
127 "float64=3.14",
128 "bool=true",
129 `time="1984-01-02 03:04:05"`,
130 "duration=1m0s",
131 `err="error value"`,
132 `any="{Field1:value Field2:42}"`,
133 }, " "),
134 )
135}
136
137func (s *FormatterPrettyTestSuite) TestGroups() {
138 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