Skip to content

Commit

Permalink
Modify StackSkip doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Segev Finer committed Jul 22, 2020
1 parent 6073017 commit 4169790
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions field.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,11 +371,8 @@ func Stack(key string) Field {
return String(key, takeStacktrace(0))
}

// StackSkip constructs a field that stores a stacktrace of the current
// goroutine under provided key, skipping the given number of frames from the
// top of the stacktrace. Keep in mind that taking a stacktrace is eager and
// expensive (relatively speaking); this function both makes an allocation and
// takes about two microseconds.
// StackSkip constructs a field similarly to Stack, but also skips the given
// number of frames from the top of the stacktrace.
func StackSkip(key string, skip int) Field {
// Returning the stacktrace as a string costs an allocation, but saves us
// from expanding the zapcore.Field union struct to include a byte slice. Since
Expand Down

0 comments on commit 4169790

Please sign in to comment.