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

Interface Hook

hooks.go:8–11  ·  hooks.go::Hook

Hook describes hooks to be fired when logging on the logging levels returned from [Hook.Levels] on your implementation of the interface. Note that this is not fired in a goroutine or a channel with workers, you should handle such functionality yourself if your call is non-blocking, and you don't wis

Source from the content-addressed store, hash-verified

6// functionality yourself if your call is non-blocking, and you don't wish for
7// the logging calls for levels returned from `Levels()` to block.
8type Hook interface {
9 Levels() []Level
10 Fire(*Entry) error
11}
12
13// LevelHooks is an internal type for storing the hooks on a logger instance.
14type LevelHooks map[Level][]Hook

Callers 12

AddMethod · 0.65
FireMethod · 0.65
TestAllHooksFunction · 0.80
TestLoggingWithHooksRaceFunction · 0.80
TestLoggingWithHooksRaceFunction · 0.80
TestHookEntryIsPristineFunction · 0.80
logMethod · 0.80
TestAllHooksFunction · 0.80

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

no outgoing calls

Tested by

no test coverage detected