aboutsummaryrefslogtreecommitdiff
path: root/internal/auth/ldap
diff options
context:
space:
mode:
authorᴜɴᴋɴᴡᴏɴ <u@gogs.io>2020-02-20 02:25:02 +0800
committerGitHub <noreply@github.com>2020-02-20 02:25:02 +0800
commit1c09373b4f7dbc68154c817b4ee44bfa3b3f637c (patch)
treeaeec9a80d10f9ef28f0d0b128f8a84bf3cb5bdb1 /internal/auth/ldap
parent422a20648466f270de195dce3bca04e977bacd13 (diff)
log: migrate to unknwon.dev/clog/v2 (#5927)
* Add unknwon.dev/clog/v2 * Update all places
Diffstat (limited to 'internal/auth/ldap')
-rw-r--r--internal/auth/ldap/ldap.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/internal/auth/ldap/ldap.go b/internal/auth/ldap/ldap.go
index e88cef77..29d95560 100644
--- a/internal/auth/ldap/ldap.go
+++ b/internal/auth/ldap/ldap.go
@@ -11,8 +11,8 @@ import (
"fmt"
"strings"
- log "gopkg.in/clog.v1"
"gopkg.in/ldap.v2"
+ log "unknwon.dev/clog/v2"
)
type SecurityProtocol int
@@ -130,7 +130,7 @@ func (ls *Source) findUserDN(l *ldap.Conn, name string) (string, bool) {
userDN := sr.Entries[0].DN
if userDN == "" {
- log.Error(2, "LDAP: Search was successful, but found no DN!")
+ log.Error("LDAP: Search was successful, but found no DN!")
return "", false
}
@@ -183,7 +183,7 @@ func (ls *Source) SearchEntry(name, passwd string, directBind bool) (string, str
}
l, err := dial(ls)
if err != nil {
- log.Error(2, "LDAP connect failed for '%s': %v", ls.Host, err)
+ log.Error("LDAP connect failed for '%s': %v", ls.Host, err)
return "", "", "", "", false, false
}
defer l.Close()
@@ -229,7 +229,7 @@ func (ls *Source) SearchEntry(name, passwd string, directBind bool) (string, str
sr, err := l.Search(search)
if err != nil {
- log.Error(2, "LDAP: User search failed: %v", err)
+ log.Error("LDAP: User search failed: %v", err)
return "", "", "", "", false, false
} else if len(sr.Entries) < 1 {
if directBind {
@@ -266,7 +266,7 @@ func (ls *Source) SearchEntry(name, passwd string, directBind bool) (string, str
srg, err := l.Search(groupSearch)
if err != nil {
- log.Error(2, "LDAP: Group search failed: %v", err)
+ log.Error("LDAP: Group search failed: %v", err)
return "", "", "", "", false, false
} else if len(srg.Entries) < 1 {
log.Trace("LDAP: Group search returned no entries")
@@ -308,7 +308,7 @@ func (ls *Source) SearchEntry(name, passwd string, directBind bool) (string, str
sr, err = l.Search(search)
if err != nil {
- log.Error(2, "LDAP: Admin search failed: %v", err)
+ log.Error("LDAP: Admin search failed: %v", err)
} else if len(sr.Entries) < 1 {
log.Trace("LDAP: Admin search returned no entries")
} else {