Fix wrong serve command log location and commit repo action

This commit is contained in:
Unknown 2014-03-25 08:53:11 -04:00
parent 09e7e76204
commit 197c4d4a5b
4 changed files with 11 additions and 7 deletions

View file

@ -45,10 +45,10 @@ gogs serv provide access auth for repositories`,
Flags: []cli.Flag{},
}
func init() {
func newLogger(execDir string) {
level := "0"
os.MkdirAll("log", os.ModePerm)
log.NewLogger(10000, "file", fmt.Sprintf(`{"level":%s,"filename":"%s"}`, level, "log/serv.log"))
log.NewLogger(10000, "file", fmt.Sprintf(`{"level":%s,"filename":"%s"}`, level, execDir+"/log/serv.log"))
log.Trace("start logging...")
}
@ -73,6 +73,8 @@ func In(b string, sl map[string]int) bool {
}
func runServ(k *cli.Context) {
execDir, _ := base.ExecDir()
newLogger(execDir)
log.Trace("new serv request " + log.Mode + ":" + log.Config)
base.NewConfigContext()