ctx error

This commit is contained in:
Gordon 2023-03-13 12:51:35 +08:00
parent 78a30a7663
commit 863e32898a

View File

@ -105,7 +105,11 @@ func SetCtxWarn(ctx context.Context, funcName string, err error, args ...interfa
} }
func SetContextInfo(ctx context.Context, funcName string, logLevel logrus.Level, err error, args ...interface{}) { func SetContextInfo(ctx context.Context, funcName string, logLevel logrus.Level, err error, args ...interface{}) {
t := ctx.Value(TraceLogKey).(*FuncInfos) var t *FuncInfos
var ok bool
if t, ok = ctx.Value(TraceLogKey).(*FuncInfos); !ok {
return
}
var funcInfo FuncInfo var funcInfo FuncInfo
funcInfo.Args = make(map[string]interface{}) funcInfo.Args = make(map[string]interface{})
argsHandle(args, funcInfo.Args) argsHandle(args, funcInfo.Args)