MCPcopy
hub / github.com/uber-go/zap / CheckWriteHook

Interface CheckWriteHook

zapcore/entry.go:164–171  ·  zapcore/entry.go::CheckWriteHook

CheckWriteHook is a custom action that may be executed after an entry is written. Register one on a CheckedEntry with the After method. if ce := logger.Check(...); ce != nil { ce = ce.After(hook) ce.Write(...) } You can configure the hook for Fatal log statements at the logger level with

Source from the content-addressed store, hash-verified

162// You can configure the hook for Fatal log statements at the logger level with
163// the zap.WithFatalHook option.
164type CheckWriteHook interface {
165 // OnWrite is invoked with the CheckedEntry that was written and a list
166 // of fields added with that entry.
167 //
168 // The list of fields DOES NOT include fields that were already added
169 // to the logger with the With method.
170 OnWrite(*CheckedEntry, []Field)
171}
172
173// CheckWriteAction indicates what action to take after a log entry is
174// processed. Actions are ordered in increasing severity.

Callers 1

WriteMethod · 0.65

Implementers 2

customWriteHooklogger_test.go
customHookzapcore/entry_test.go

Calls

no outgoing calls

Tested by

no test coverage detected