Output a standard log template with a simple message to default output channel. Write a final newline at the end of every message.
(lvl Level, calldepth int, message string)
| 160 | // Output a standard log template with a simple message to default output channel. |
| 161 | // Write a final newline at the end of every message. |
| 162 | func (l *Logger) Output(lvl Level, calldepth int, message string) { |
| 163 | l.mu.Lock() |
| 164 | defer l.mu.Unlock() |
| 165 | if !l.stdEnabled { |
| 166 | return |
| 167 | } |
| 168 | msg := l.formatLogMessage(calldepth+1, message) |
| 169 | |
| 170 | var err error |
| 171 | switch lvl { |
| 172 | case ERROR: |
| 173 | _, err = l.errWriter.Write(msg) |
| 174 | default: |
| 175 | _, err = l.writer.Write(msg) |
| 176 | } |
| 177 | if err != nil { |
| 178 | panic(err) |
| 179 | } |
| 180 | } |
| 181 | |
| 182 | // PrintAuthf writes auth info to the logger. Requires an http.Request to |
| 183 | // log request details. Remaining arguments are handled in the manner of |