错误日志打印堆栈
This commit is contained in:
parent
4f013f593e
commit
4e31cf90df
|
@ -7,6 +7,7 @@ import (
|
||||||
"go.uber.org/zap/zapcore"
|
"go.uber.org/zap/zapcore"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime/debug"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -99,6 +100,7 @@ func Debug(msg string, fields ...zap.Field) {
|
||||||
|
|
||||||
func Error(msg string, fields ...zap.Field) {
|
func Error(msg string, fields ...zap.Field) {
|
||||||
logger.Error(msg, fields...)
|
logger.Error(msg, fields...)
|
||||||
|
fmt.Println(string(debug.Stack()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetProd() {
|
func SetProd() {
|
||||||
|
|
Loading…
Reference in New Issue