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

Function ExampleLogger_Writer_stdlib

writer_test.go:35–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33}
34
35func ExampleLogger_Writer_stdlib() {
36 logger := logrus.New()
37 logger.Formatter = &logrus.JSONFormatter{}
38
39 // Use logrus for standard log output
40 // Note that `log` here references stdlib's log
41 // Not logrus imported under the name `log`.
42 log.SetOutput(logger.Writer())
43}
44
45type bufferWithMu struct {
46 buf *bytes.Buffer

Callers

nothing calls this directly

Calls 3

NewFunction · 0.92
SetOutputMethod · 0.80
WriterMethod · 0.45

Tested by

no test coverage detected