diff options
author | Unknwon <u@gogs.io> | 2017-02-09 19:29:59 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-02-09 19:29:59 -0500 |
commit | eb66060cd7b9bce996b1d75ae80ce1ef31d5ce62 (patch) | |
tree | cb692b6a3504985f3d0de7de159a4b8cc6f0d4a5 /routers/repo | |
parent | 8a19f8a63c12fb1119c86fa65fa408ecba00bc6c (diff) |
log: start using gopkg.in/clog.v1
Diffstat (limited to 'routers/repo')
-rw-r--r-- | routers/repo/branch.go | 3 | ||||
-rw-r--r-- | routers/repo/editor.go | 3 | ||||
-rw-r--r-- | routers/repo/http.go | 19 | ||||
-rw-r--r-- | routers/repo/issue.go | 2 | ||||
-rw-r--r-- | routers/repo/pull.go | 2 | ||||
-rw-r--r-- | routers/repo/release.go | 3 | ||||
-rw-r--r-- | routers/repo/repo.go | 2 | ||||
-rw-r--r-- | routers/repo/setting.go | 3 | ||||
-rw-r--r-- | routers/repo/view.go | 2 |
9 files changed, 22 insertions, 17 deletions
diff --git a/routers/repo/branch.go b/routers/repo/branch.go index 7bc75977..4f32429f 100644 --- a/routers/repo/branch.go +++ b/routers/repo/branch.go @@ -5,11 +5,12 @@ package repo import ( + log "gopkg.in/clog.v1" + "github.com/gogits/git-module" "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/context" - "github.com/gogits/gogs/modules/log" ) const ( diff --git a/routers/repo/editor.go b/routers/repo/editor.go index b1678f68..82a2cb8c 100644 --- a/routers/repo/editor.go +++ b/routers/repo/editor.go @@ -11,12 +11,13 @@ import ( "path" "strings" + log "gopkg.in/clog.v1" + "github.com/gogits/git-module" "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/auth" "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/context" - "github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/setting" "github.com/gogits/gogs/modules/template" ) diff --git a/routers/repo/http.go b/routers/repo/http.go index fc83fa87..805b5189 100644 --- a/routers/repo/http.go +++ b/routers/repo/http.go @@ -20,12 +20,13 @@ import ( "strings" "time" + log "gopkg.in/clog.v1" + git "github.com/gogits/git-module" "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/context" - "github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/setting" ) @@ -315,7 +316,7 @@ func gitCommand(dir string, args ...string) []byte { cmd.Dir = dir out, err := cmd.Output() if err != nil { - log.GitLogger.Error(4, fmt.Sprintf("%v - %s", err, out)) + log.Error(4, fmt.Sprintf("Git: %v - %s", err, out)) } return out } @@ -376,7 +377,7 @@ func serviceRPC(h serviceHandler, service string) { if h.r.Header.Get("Content-Encoding") == "gzip" { reqBody, err = gzip.NewReader(reqBody) if err != nil { - log.GitLogger.Error(2, "fail to create gzip reader: %v", err) + log.Error(2, "Git: fail to create gzip reader: %v", err) h.w.WriteHeader(http.StatusInternalServerError) return } @@ -385,7 +386,7 @@ func serviceRPC(h serviceHandler, service string) { if h.cfg.OnSucceed != nil { tmpfile, err := ioutil.TempFile("", "gogs") if err != nil { - log.GitLogger.Error(2, "fail to create temporary file: %v", err) + log.Error(2, "Git: fail to create temporary file: %v", err) h.w.WriteHeader(http.StatusInternalServerError) return } @@ -393,7 +394,7 @@ func serviceRPC(h serviceHandler, service string) { _, err = io.Copy(tmpfile, reqBody) if err != nil { - log.GitLogger.Error(2, "fail to save request body: %v", err) + log.Error(2, "Git: fail to save request body: %v", err) h.w.WriteHeader(http.StatusInternalServerError) return } @@ -402,7 +403,7 @@ func serviceRPC(h serviceHandler, service string) { tmpFilename = tmpfile.Name() tmpfile, err = os.Open(tmpFilename) if err != nil { - log.GitLogger.Error(2, "fail to open temporary file: %v", err) + log.Error(2, "Git: fail to open temporary file: %v", err) h.w.WriteHeader(http.StatusInternalServerError) return } @@ -420,7 +421,7 @@ func serviceRPC(h serviceHandler, service string) { cmd.Stderr = &stderr cmd.Stdin = br if err := cmd.Run(); err != nil { - log.GitLogger.Error(2, "fail to serve RPC(%s): %v - %s", service, err, stderr) + log.Error(2, "Git: fail to serve RPC '%s': %v - %s", service, err, stderr) h.w.WriteHeader(http.StatusInternalServerError) return } @@ -428,7 +429,7 @@ func serviceRPC(h serviceHandler, service string) { if h.cfg.OnSucceed != nil { input, err := os.Open(tmpFilename) if err != nil { - log.GitLogger.Error(2, "fail to open temporary file: %v", err) + log.Error(2, "Git: fail to open temporary file: %v", err) h.w.WriteHeader(http.StatusInternalServerError) return } @@ -545,7 +546,7 @@ func HTTPBackend(ctx *context.Context, cfg *serviceConfig) http.HandlerFunc { file := strings.Replace(r.URL.Path, m[1]+"/", "", 1) dir, err := getGitRepoPath(m[1]) if err != nil { - log.GitLogger.Error(4, err.Error()) + log.Error(4, "Git: getGitRepoPath: %v", err) ctx.Handle(http.StatusNotFound, "HTTPBackend", err) return } diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 0315851a..3884b31c 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -16,12 +16,12 @@ import ( "github.com/Unknwon/com" "github.com/Unknwon/paginater" + log "gopkg.in/clog.v1" "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/auth" "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/context" - "github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/markdown" "github.com/gogits/gogs/modules/setting" ) diff --git a/routers/repo/pull.go b/routers/repo/pull.go index d99d5c83..8aa37bb2 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -10,6 +10,7 @@ import ( "strings" "github.com/Unknwon/com" + log "gopkg.in/clog.v1" "github.com/gogits/git-module" @@ -17,7 +18,6 @@ import ( "github.com/gogits/gogs/modules/auth" "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/context" - "github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/setting" ) diff --git a/routers/repo/release.go b/routers/repo/release.go index 661aa4e2..f7dd888f 100644 --- a/routers/repo/release.go +++ b/routers/repo/release.go @@ -7,11 +7,12 @@ package repo import ( "fmt" + log "gopkg.in/clog.v1" + "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/auth" "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/context" - "github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/markdown" ) diff --git a/routers/repo/repo.go b/routers/repo/repo.go index 74ee3c4f..8a088c98 100644 --- a/routers/repo/repo.go +++ b/routers/repo/repo.go @@ -11,6 +11,7 @@ import ( "strings" "github.com/Unknwon/com" + log "gopkg.in/clog.v1" "github.com/gogits/git-module" @@ -18,7 +19,6 @@ import ( "github.com/gogits/gogs/modules/auth" "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/context" - "github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/setting" ) diff --git a/routers/repo/setting.go b/routers/repo/setting.go index 01228da8..bcb6dc89 100644 --- a/routers/repo/setting.go +++ b/routers/repo/setting.go @@ -8,13 +8,14 @@ import ( "strings" "time" + log "gopkg.in/clog.v1" + "github.com/gogits/git-module" "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/auth" "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/context" - "github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/mailer" "github.com/gogits/gogs/modules/setting" ) diff --git a/routers/repo/view.go b/routers/repo/view.go index 3e49b3fa..e66575c9 100644 --- a/routers/repo/view.go +++ b/routers/repo/view.go @@ -13,13 +13,13 @@ import ( "strings" "github.com/Unknwon/paginater" + log "gopkg.in/clog.v1" "github.com/gogits/git-module" "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/context" - "github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/markdown" "github.com/gogits/gogs/modules/setting" "github.com/gogits/gogs/modules/template" |