Skip to content

Commit

Permalink
stack with \n end
Browse files Browse the repository at this point in the history
  • Loading branch information
omigo committed Jul 20, 2017
1 parent 700f0b2 commit 7bc0b1c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion standard.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,12 @@ func (s *Standard) Tprintf(l Level, tag string, format string, m ...interface{})
if l == Lstack {
r.Stack = make([]byte, 4096)
n := runtime.Stack(r.Stack, true)
r.Stack = r.Stack[:n]
if n == 4096 {
r.Stack[n-1] = '\n'
} else {
r.Stack[n] = '\n'
r.Stack = r.Stack[:n+1]
}
}

if s.colorized {
Expand Down

0 comments on commit 7bc0b1c

Please sign in to comment.