diff options
author | Unknown <joe2010xtmf@163.com> | 2014-04-06 13:00:20 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-04-06 13:00:20 -0400 |
commit | 2846ff7d31fc93659a2e90fe869ff51c885decfa (patch) | |
tree | 07f6c991fb4e6e2d09a7aee331dc45ce4caa1364 /web.go | |
parent | d3a987eded8bf2d0afc35dce32238e59da8080a8 (diff) | |
download | gitea-2846ff7d31fc93659a2e90fe869ff51c885decfa.tar.gz gitea-2846ff7d31fc93659a2e90fe869ff51c885decfa.zip |
Fix bug related to log
Diffstat (limited to 'web.go')
-rw-r--r-- | web.go | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -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()) } } } |