- global Log instance.

- CallFuncLogError.
This commit is contained in:
gazebo
2018-06-20 15:04:00 +08:00
parent 363f01857e
commit 55df9f7a2f
2 changed files with 22 additions and 0 deletions

View File

@@ -11,6 +11,8 @@ import (
"strings"
"time"
"git.rosy.net.cn/baseapi"
"github.com/satori/go.uuid"
)
@@ -185,3 +187,10 @@ func MergeMaps(firstMap map[string]interface{}, otherMaps ...map[string]interfac
return retVal
}
func CallFuncLogError(funcToCall func() error, msg string) {
err := funcToCall()
if err != nil {
baseapi.SugarLogger.Warnf("%s, error:%v", err.Error())
}
}