From 2846ff7d31fc93659a2e90fe869ff51c885decfa Mon Sep 17 00:00:00 2001 From: Unknown Date: Sun, 6 Apr 2014 13:00:20 -0400 Subject: Fix bug related to log --- web.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'web.go') 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()) } } } -- cgit v1.2.3