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

Function Stack

field.go:367–369  ·  view source on GitHub ↗

Stack constructs a field that stores a stacktrace of the current goroutine under provided key. Keep in mind that taking a stacktrace is eager and expensive (relatively speaking); this function both makes an allocation and takes about two microseconds.

(key string)

Source from the content-addressed store, hash-verified

365// expensive (relatively speaking); this function both makes an allocation and
366// takes about two microseconds.
367func Stack(key string) Field {
368 return StackSkip(key, 1) // skip Stack
369}
370
371// StackSkip constructs a field similarly to Stack, but also skips the given
372// number of frames from the top of the stacktrace.

Callers 2

TestStackFieldFunction · 0.70
BenchmarkStackFieldFunction · 0.70

Calls 1

StackSkipFunction · 0.85

Tested by 2

TestStackFieldFunction · 0.56
BenchmarkStackFieldFunction · 0.56