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

Function TestJSONEntryEndsWithNewline

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

Source from the content-addressed store, hash-verified

205}
206
207func TestJSONEntryEndsWithNewline(t *testing.T) {
208 formatter := &JSONFormatter{}
209
210 b, err := formatter.Format(WithField("level", "something"))
211 if err != nil {
212 t.Fatal("Unable to format entry: ", err)
213 }
214
215 if b[len(b)-1] != '\n' {
216 t.Fatal("Expected JSON log entry to end with a newline")
217 }
218}
219
220func TestJSONMessageKey(t *testing.T) {
221 formatter := &JSONFormatter{

Callers

nothing calls this directly

Calls 3

FormatMethod · 0.95
WithFieldFunction · 0.85
FatalMethod · 0.65

Tested by

no test coverage detected