MCPcopy Create free account
hub / github.com/labstack/gommon / SetOutput

Method SetOutput

log/log.go:125–130  ·  view source on GitHub ↗
(w io.Writer)

Source from the content-addressed store, hash-verified

123}
124
125func (l *Logger) SetOutput(w io.Writer) {
126 l.output = w
127 if w, ok := w.(*os.File); !ok || !isatty.IsTerminal(w.Fd()) {
128 l.DisableColor()
129 }
130}
131
132func (l *Logger) Color() *color.Color {
133 return l.color

Callers 9

testFunction · 0.45
TestFormatFunction · 0.45
TestJSONFunction · 0.45
TestStringWithQuotesFunction · 0.45
TestEmptyHeaderFunction · 0.45
TestCallerFileFunction · 0.45
BenchmarkLogFunction · 0.45
NewFunction · 0.45
SetOutputFunction · 0.45

Calls 1

DisableColorMethod · 0.95

Tested by 7

testFunction · 0.36
TestFormatFunction · 0.36
TestJSONFunction · 0.36
TestStringWithQuotesFunction · 0.36
TestEmptyHeaderFunction · 0.36
TestCallerFileFunction · 0.36
BenchmarkLogFunction · 0.36