summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-06-20 01:14:54 -0400
committerUnknown <joe2010xtmf@163.com>2014-06-20 01:14:54 -0400
commit8bfa7ae7453e56191aa6f7de8067d5b6bb5a4a8b (patch)
treef96bf4166b78a123997a3eb3026cb347b5c3bcc6 /models
parent6c8d630bef3a58860237856c648e56f4b9cea97d (diff)
downloadgitea-8bfa7ae7453e56191aa6f7de8067d5b6bb5a4a8b.tar.gz
gitea-8bfa7ae7453e56191aa6f7de8067d5b6bb5a4a8b.zip
Remove qiniu/log
Diffstat (limited to 'models')
-rw-r--r--models/action.go3
-rw-r--r--models/publickey.go7
-rw-r--r--models/update.go23
3 files changed, 15 insertions, 18 deletions
diff --git a/models/action.go b/models/action.go
index e39b04a1ad..2846823386 100644
--- a/models/action.go
+++ b/models/action.go
@@ -12,7 +12,6 @@ import (
"time"
"github.com/gogits/git"
- qlog "github.com/qiniu/log"
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/log"
@@ -115,7 +114,7 @@ func CommitRepoAction(userId, repoUserId int64, userName, actEmail string,
return errors.New("action.CommitRepoAction(NotifyWatchers): " + err.Error())
}
- qlog.Info("action.CommitRepoAction(end): %d/%s", repoUserId, repoName)
+ //qlog.Info("action.CommitRepoAction(end): %d/%s", repoUserId, repoName)
// New push event hook.
if err := repo.GetOwner(); err != nil {
diff --git a/models/publickey.go b/models/publickey.go
index 72b45c5b89..b0021a6880 100644
--- a/models/publickey.go
+++ b/models/publickey.go
@@ -19,7 +19,6 @@ import (
"time"
"github.com/Unknwon/com"
- qlog "github.com/qiniu/log"
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/process"
@@ -55,7 +54,7 @@ func exePath() (string, error) {
func homeDir() string {
home, err := com.HomeDir()
if err != nil {
- qlog.Fatalln(err)
+ log.Fatal("Fail to get home directory: %v", err)
}
return home
}
@@ -64,13 +63,13 @@ func init() {
var err error
if appPath, err = exePath(); err != nil {
- qlog.Fatalf("publickey.init(fail to get app path): %v\n", err)
+ log.Fatal("publickey.init(fail to get app path): %v\n", err)
}
// Determine and create .ssh path.
SshPath = filepath.Join(homeDir(), ".ssh")
if err = os.MkdirAll(SshPath, os.ModePerm); err != nil {
- qlog.Fatalf("publickey.init(fail to create SshPath(%s)): %v\n", SshPath, err)
+ log.Fatal("publickey.init(fail to create SshPath(%s)): %v\n", SshPath, err)
}
}
diff --git a/models/update.go b/models/update.go
index b7242cde85..5675a94cf4 100644
--- a/models/update.go
+++ b/models/update.go
@@ -9,18 +9,17 @@ import (
"os/exec"
"strings"
- qlog "github.com/qiniu/log"
-
"github.com/gogits/git"
"github.com/gogits/gogs/modules/base"
+ "github.com/gogits/gogs/modules/log"
)
func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName string, userId int64) {
isNew := strings.HasPrefix(oldCommitId, "0000000")
if isNew &&
strings.HasPrefix(newCommitId, "0000000") {
- qlog.Fatal("old rev and new rev both 000000")
+ log.GitLogger.Fatal("old rev and new rev both 000000")
}
f := RepoPath(repoUserName, repoName)
@@ -31,18 +30,18 @@ func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName
isDel := strings.HasPrefix(newCommitId, "0000000")
if isDel {
- qlog.Info("del rev", refName, "from", userName+"/"+repoName+".git", "by", userId)
+ log.GitLogger.Info("del rev", refName, "from", userName+"/"+repoName+".git", "by", userId)
return
}
repo, err := git.OpenRepository(f)
if err != nil {
- qlog.Fatalf("runUpdate.Open repoId: %v", err)
+ log.GitLogger.Fatal("runUpdate.Open repoId: %v", err)
}
newCommit, err := repo.GetCommit(newCommitId)
if err != nil {
- qlog.Fatalf("runUpdate GetCommit of newCommitId: %v", err)
+ log.GitLogger.Fatal("runUpdate GetCommit of newCommitId: %v", err)
return
}
@@ -51,28 +50,28 @@ func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName
if isNew {
l, err = newCommit.CommitsBefore()
if err != nil {
- qlog.Fatalf("Find CommitsBefore erro: %v", err)
+ log.GitLogger.Fatal("Find CommitsBefore erro: %v", err)
}
} else {
l, err = newCommit.CommitsBeforeUntil(oldCommitId)
if err != nil {
- qlog.Fatalf("Find CommitsBeforeUntil erro: %v", err)
+ log.GitLogger.Fatal("Find CommitsBeforeUntil erro: %v", err)
return
}
}
if err != nil {
- qlog.Fatalf("runUpdate.Commit repoId: %v", err)
+ log.GitLogger.Fatal("runUpdate.Commit repoId: %v", err)
}
ru, err := GetUserByName(repoUserName)
if err != nil {
- qlog.Fatalf("runUpdate.GetUserByName: %v", err)
+ log.GitLogger.Fatal("runUpdate.GetUserByName: %v", err)
}
repos, err := GetRepositoryByName(ru.Id, repoName)
if err != nil {
- qlog.Fatalf("runUpdate.GetRepositoryByName userId: %v", err)
+ log.GitLogger.Fatal("runUpdate.GetRepositoryByName userId: %v", err)
}
commits := make([]*base.PushCommit, 0)
@@ -96,6 +95,6 @@ func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName
//commits = append(commits, []string{lastCommit.Id().String(), lastCommit.Message()})
if err = CommitRepoAction(userId, ru.Id, userName, actEmail,
repos.Id, repoUserName, repoName, refName, &base.PushCommits{l.Len(), commits}); err != nil {
- qlog.Fatalf("runUpdate.models.CommitRepoAction: %s/%s:%v", repoUserName, repoName, err)
+ log.GitLogger.Fatal("runUpdate.models.CommitRepoAction: %s/%s:%v", repoUserName, repoName, err)
}
}