Use gitea logging module for git module (#16243)
remove log() func from gogs times and switch to proper logging Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
44b8b07631
commit
3ef23d5411
19 changed files with 60 additions and 58 deletions
|
@ -10,6 +10,8 @@ import (
|
|||
"context"
|
||||
"path"
|
||||
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
|
||||
"github.com/go-git/go-git/v5/plumbing/object"
|
||||
cgobject "github.com/go-git/go-git/v5/plumbing/object/commitgraph"
|
||||
)
|
||||
|
@ -41,9 +43,9 @@ func NewLastCommitCache(repoPath string, gitRepo *Repository, ttl func() int64,
|
|||
func (c *LastCommitCache) Get(ref, entryPath string) (interface{}, error) {
|
||||
v := c.cache.Get(c.getCacheKey(c.repoPath, ref, entryPath))
|
||||
if vs, ok := v.(string); ok {
|
||||
log("LastCommitCache hit level 1: [%s:%s:%s]", ref, entryPath, vs)
|
||||
log.Debug("LastCommitCache hit level 1: [%s:%s:%s]", ref, entryPath, vs)
|
||||
if commit, ok := c.commitCache[vs]; ok {
|
||||
log("LastCommitCache hit level 2: [%s:%s:%s]", ref, entryPath, vs)
|
||||
log.Debug("LastCommitCache hit level 2: [%s:%s:%s]", ref, entryPath, vs)
|
||||
return commit, nil
|
||||
}
|
||||
id, err := c.repo.ConvertToSHA1(vs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue