Fire will be called when some logging function is called with current hook It will format log entry to string and write it to appropriate writer
(entry *log.Entry)
| 15 | // Fire will be called when some logging function is called with current hook |
| 16 | // It will format log entry to string and write it to appropriate writer |
| 17 | func (hook *Hook) Fire(entry *log.Entry) error { |
| 18 | line, err := entry.Bytes() |
| 19 | if err != nil { |
| 20 | return err |
| 21 | } |
| 22 | _, err = hook.Writer.Write(line) |
| 23 | return err |
| 24 | } |
| 25 | |
| 26 | // Levels define on which log levels this hook would trigger |
| 27 | func (hook *Hook) Levels() []log.Level { |
nothing calls this directly
no test coverage detected