optimize log tool
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// Error 框架层处理错误
|
||||
type Error struct {
|
||||
*logrus.Logger
|
||||
error
|
||||
}
|
||||
|
||||
@@ -13,5 +18,10 @@ func (that *Error) GetError() error {
|
||||
|
||||
func (that *Error) SetError(err error) {
|
||||
that.error = err
|
||||
if that.Logger != nil {
|
||||
//that.Logger=log.GetLog("",false)
|
||||
that.Logger.Warn(err)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user