Debian Codegraph @

handler.go

raw symbols SCIP
1 package loggscip-go gomod github.com/bep/logg . `github.com/bep/logg`/
2
3 // Handler is used to handle log events, outputting them to
4 // stdio or sending them to remote services. See the "handlers"
5 // directory for implementations.
6 //
7 // It is left up to Handlers to implement thread-safety.
8 type Handlerscip-go gomod github.com/bep/logg . `github.com/bep/logg`/Handler# interface {
9 // HandleLog is invoked for each log event.
10 // Note that if the Entry is going to be used after the call to HandleLog
11 // in the handler chain returns, it must be cloned with Clone(). See
12 // the memory.Handler implementation for an example.
13 //
14 // The Entry can be modified if needed, e.g. when passed down via
15 // a multi.Handler (e.g. to sanitize the data).
16 HandleLogscip-go gomod github.com/bep/logg . `github.com/bep/logg`/Handler#HandleLog.(e *Entryscip-go gomod github.com/bep/logg . `github.com/bep/logg`/Entry#) error
17 }
18
19 // The HandlerFunc type is an adapter to allow the use of ordinary functions as
20 // log handlers. If f is a function with the appropriate signature,
21 // HandlerFunc(f) is a Handler object that calls f.
22 type HandlerFuncscip-go gomod github.com/bep/logg . `github.com/bep/logg`/HandlerFunc# func(*Entryscip-go gomod github.com/bep/logg . `github.com/bep/logg`/Entry#) error
23
24 // HandleLog calls f(e).
25 func (f HandlerFuncscip-go gomod github.com/bep/logg . `github.com/bep/logg`/HandlerFunc#) HandleLogscip-go gomod github.com/bep/logg . `github.com/bep/logg`/HandlerFunc#HandleLog().(e *Entryscip-go gomod github.com/bep/logg . `github.com/bep/logg`/Entry#) error {
26 return f(e)
27 }