summaryrefslogtreecommitdiffstats
path: root/web.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-04-06 13:00:20 -0400
committerUnknown <joe2010xtmf@163.com>2014-04-06 13:00:20 -0400
commit2846ff7d31fc93659a2e90fe869ff51c885decfa (patch)
tree07f6c991fb4e6e2d09a7aee331dc45ce4caa1364 /web.go
parentd3a987eded8bf2d0afc35dce32238e59da8080a8 (diff)
downloadgitea-2846ff7d31fc93659a2e90fe869ff51c885decfa.tar.gz
gitea-2846ff7d31fc93659a2e90fe869ff51c885decfa.zip
Fix bug related to log
Diffstat (limited to 'web.go')
-rw-r--r--web.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/web.go b/web.go
index cab3dfeccd..00fa72cbce 100644
--- a/web.go
+++ b/web.go
@@ -11,6 +11,7 @@ import (
"github.com/codegangsta/cli"
"github.com/go-martini/martini"
+ qlog "github.com/qiniu/log"
"github.com/gogits/binding"
@@ -50,9 +51,7 @@ func newMartini() *martini.ClassicMartini {
}
func runWeb(*cli.Context) {
- fmt.Println("Server is running...")
routers.GlobalInit()
- log.Info("%s %s", base.AppName, base.AppVer)
m := newMartini()
@@ -147,7 +146,7 @@ func runWeb(*cli.Context) {
r.Get("/issues", repo.Issues)
r.Get("/issues/:index", repo.ViewIssue)
r.Get("/releases", repo.Releases)
- r.Any("/releases/new",repo.ReleasesNew)
+ r.Any("/releases/new", repo.ReleasesNew)
r.Get("/pulls", repo.Pulls)
r.Get("/branches", repo.Branches)
}, ignSignIn, middleware.RepoAssignment(true))
@@ -177,14 +176,13 @@ func runWeb(*cli.Context) {
if protocol == "http" {
log.Info("Listen: http://%s", listenAddr)
if err := http.ListenAndServe(listenAddr, m); err != nil {
- fmt.Println(err.Error())
- //log.Critical(err.Error()) // not working now
+ qlog.Error(err.Error())
}
} else if protocol == "https" {
log.Info("Listen: https://%s", listenAddr)
if err := http.ListenAndServeTLS(listenAddr, base.Cfg.MustValue("server", "CERT_FILE"),
base.Cfg.MustValue("server", "KEY_FILE"), m); err != nil {
- fmt.Println(err.Error())
+ qlog.Error(err.Error())
}
}
}