Write implements io.Writer, all bytes sent to it will be written as a separate log messages. No line-buffering is done.
(s []byte)
| 198 | // to it will be written as a separate log messages. |
| 199 | // No line-buffering is done. |
| 200 | func (l *Logger) Write(s []byte) (int, error) { |
| 201 | if !l.IsDebug() { |
| 202 | return len(s), nil |
| 203 | } |
| 204 | l.log(false, strings.TrimRight(string(s), "\n")) |
| 205 | return len(s), nil |
| 206 | } |
| 207 | |
| 208 | // Close closes underlying output in Out. |
| 209 | func (l *Logger) Close() error { |