Documentation ¶
Index ¶
- Variables
- func CheckFatal(err error)
- func InjectHandler(mainLog Interface) func(http.Handler) http.Handler
- func LogPanicWithStack(log Interface, location string, r interface{}, vals ...interface{}) error
- func Logger(name string) kitlog.Logger
- func NewContext(ctx context.Context, log Interface) context.Context
- func RecoveryHandler() func(http.Handler) http.Handler
- func SetCloseChan(c chan<- os.Signal)
- func SetupLogging(w io.Writer)
- func Writer(unit string, l kitlog.Logger) io.WriteCloser
- type Interface
Constants ¶
This section is empty.
Variables ¶
View Source
var LogCTXKey logctxKeyT = "loggingContextKey"
LogCTXKey is the typed context key
Functions ¶
func InjectHandler ¶
InjectHandler injects a log instance to http.Request' context
func LogPanicWithStack ¶ added in v1.6.0
LogPanicWithStack writes the passed value r, together with a debug.Stack to a tmpfile and logs its location
func NewContext ¶
NewContext helps constructing and wrapping a logger into a context
func RecoveryHandler ¶
RecoveryHandler recovers handler panics and logs them using LogPanicWithStack
func SetCloseChan ¶
SetCloseChan sets a signal channel that is sent to when CheckFatal is used
func SetupLogging ¶
SetupLogging will initialize the logger backend and set the flags.
Types ¶
Click to show internal directories.
Click to hide internal directories.