NewNullLogger creates a discarding logger and installs the test hook.
()
| 40 | |
| 41 | // NewNullLogger creates a discarding logger and installs the test hook. |
| 42 | func NewNullLogger() (*logrus.Logger, *Hook) { |
| 43 | |
| 44 | logger := logrus.New() |
| 45 | logger.Out = io.Discard |
| 46 | |
| 47 | return logger, NewLocal(logger) |
| 48 | |
| 49 | } |
| 50 | |
| 51 | func (t *Hook) Fire(e *logrus.Entry) error { |
| 52 | t.mu.Lock() |