feat:update log
This commit is contained in:
1 parent
0768efbcb3
commit
f3adadd6ef
20 files changed
+194
-146
No files matched your search
+2
-3
@@ -1,7 +1,6 @@
|
||||
package tools
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
"strconv"
|
||||
)
|
||||
@@ -19,7 +18,7 @@ func StrToInt(err error, index string) int {
|
||||
func CompareHashAndPassword(e string, p string) (bool, error) {
|
||||
err := bcrypt.CompareHashAndPassword([]byte(e), []byte(p))
|
||||
if err != nil {
|
||||
log.Print(err.Error())
|
||||
Logger.Print(err.Error())
|
||||
return false, err
|
||||
}
|
||||
return true, nil
|
||||
@@ -51,7 +50,7 @@ func HasError(err error, msg string, code ...int) {
|
||||
if msg == "" {
|
||||
msg = err.Error()
|
||||
}
|
||||
log.Println(err)
|
||||
Logger.Println(err)
|
||||
panic("CustomError#" + strconv.Itoa(statusCode) + "#" + msg)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user