MCPcopy
hub / github.com/rs/zerolog / CallerWithSkipFrameCount

Method CallerWithSkipFrameCount

context.go:496–499  ·  view source on GitHub ↗

CallerWithSkipFrameCount adds the file:line of the caller with the zerolog.CallerFieldName key. The specified skipFrameCount int will override the global CallerSkipFrameCount for this context's respective logger. If set to -1 the global CallerSkipFrameCount will be used.

(skipFrameCount int)

Source from the content-addressed store, hash-verified

494// The specified skipFrameCount int will override the global CallerSkipFrameCount for this context's respective logger.
495// If set to -1 the global CallerSkipFrameCount will be used.
496func (c Context) CallerWithSkipFrameCount(skipFrameCount int) Context {
497 c.l = c.l.Hook(newCallerHook(skipFrameCount))
498 return c
499}
500
501// Stack enables stack trace printing for the error passed to Err().
502func (c Context) Stack() Context {

Callers 1

TestWithFunction · 0.80

Calls 2

newCallerHookFunction · 0.85
HookMethod · 0.80

Tested by 1

TestWithFunction · 0.64