From 7bc0b1c0d6cba3a2afc05b65a53907d96dc6cfe8 Mon Sep 17 00:00:00 2001 From: Arstd Date: Thu, 20 Jul 2017 21:32:07 +0800 Subject: [PATCH] stack with \n end --- standard.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/standard.go b/standard.go index 370f962..5c30c75 100644 --- a/standard.go +++ b/standard.go @@ -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 {