MCPcopy
hub / github.com/sirupsen/logrus / Fire

Method Fire

hooks/writer/writer.go:17–24  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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
17func (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
27func (hook *Hook) Levels() []log.Level {

Callers

nothing calls this directly

Implementers 10

panickyHookentry_test.go
DefaultFieldHookexample_default_field_value_test.go
TestHookhook_test.go
ModifyHookhook_test.go
ErrorHookhook_test.go
HookCallFunchook_test.go
GlobalHookexample_global_hook_test.go
Hookhooks/writer/writer.go
Hookhooks/test/test.go
SyslogHookhooks/syslog/syslog.go

Calls 2

BytesMethod · 0.80
WriteMethod · 0.45

Tested by

no test coverage detected