Refactor "app/authorization.go" to use structured logging (#12233)

This commit is contained in:
sowmiyamuthuraman
2019-09-18 23:32:22 +05:30
committed by Ben Schumacher
parent c7b583ccdd
commit be0d13578d

View File

@@ -4,7 +4,6 @@
package app
import (
"fmt"
"net/http"
"strings"
@@ -192,8 +191,7 @@ func (a *App) RolesGrantPermission(roleNames []string, permissionId string) bool
if err != nil {
// This should only happen if something is very broken. We can't realistically
// recover the situation, so deny permission and log an error.
mlog.Error("Failed to get roles from database with role names: " + strings.Join(roleNames, ","))
mlog.Error(fmt.Sprint(err))
mlog.Error("Failed to get roles from database with role names: "+strings.Join(roleNames, ",")+" ", mlog.Err(err))
return false
}