MCPcopy
hub / github.com/sirupsen/logrus / TestJSONEnableTimestamp

Function TestJSONEnableTimestamp

json_formatter_test.go:335–346  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

333}
334
335func TestJSONEnableTimestamp(t *testing.T) {
336 formatter := &JSONFormatter{}
337
338 b, err := formatter.Format(WithField("level", "something"))
339 if err != nil {
340 t.Fatal("Unable to format entry: ", err)
341 }
342 s := string(b)
343 if !strings.Contains(s, FieldKeyTime) {
344 t.Error("Timestamp not present", s)
345 }
346}
347
348func TestJSONDisableHTMLEscape(t *testing.T) {
349 formatter := &JSONFormatter{DisableHTMLEscape: true}

Callers

nothing calls this directly

Calls 4

FormatMethod · 0.95
WithFieldFunction · 0.85
FatalMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…