flush flushes the buffered data to the logger, allowing empty messages only if the bool is set.
(allowEmpty bool)
| 136 | // flush flushes the buffered data to the logger, allowing empty messages only |
| 137 | // if the bool is set. |
| 138 | func (w *Writer) flush(allowEmpty bool) { |
| 139 | if allowEmpty || w.buff.Len() > 0 { |
| 140 | w.log(w.buff.Bytes()) |
| 141 | } |
| 142 | w.buff.Reset() |
| 143 | } |
| 144 | |
| 145 | func (w *Writer) log(b []byte) { |
| 146 | if ce := w.Log.Check(w.Level, string(b)); ce != nil { |