summaryrefslogtreecommitdiffstats
path: root/update.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2014-03-26 00:00:36 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2014-03-26 00:00:36 +0800
commit9b509054cf8ef8e15cf567614aef46fe12571904 (patch)
tree7ff242e1a253210b851437b5062de6149a4d1b49 /update.go
parent20ec459b93a68c8bf4b32fafc0532b569f5e1c5e (diff)
downloadgitea-9b509054cf8ef8e15cf567614aef46fe12571904.tar.gz
gitea-9b509054cf8ef8e15cf567614aef46fe12571904.zip
bug fixed
Diffstat (limited to 'update.go')
-rw-r--r--update.go24
1 files changed, 17 insertions, 7 deletions
diff --git a/update.go b/update.go
index 915e046530..ebc51b2a0c 100644
--- a/update.go
+++ b/update.go
@@ -4,9 +4,12 @@
package main
-import "github.com/codegangsta/cli"
-
-//"github.com/gogits/gogs/modules/log"
+import (
+"fmt"
+"os"
+"github.com/codegangsta/cli"
+"github.com/gogits/gogs/modules/log"
+)
var CmdUpdate = cli.Command{
Name: "update",
@@ -18,11 +21,18 @@ gogs serv provide access auth for repositories`,
}
// for command: ./gogs update
-func runUpdate(*cli.Context) {
- /*w, _ := os.Create("update.log")
- log.SetOutput(w)
+func runUpdate(c *cli.Context) {
+ level := "0"
+ os.MkdirAll("log", os.ModePerm)
+ log.NewLogger(10000, "file", fmt.Sprintf(`{"level":%s,"filename":"%s"}`, level, "log/serv.log"))
+ log.Info("start update logging...")
- userName := os.Getenv("userName")
+ //w, _ := os.Create("update.log")
+ //log.SetOutput(w)
+ for i, arg := range c.Args() {
+ log.Info("%d : %s", i, arg)
+}
+ /*userName := os.Getenv("userName")
userId := os.Getenv("userId")
repoId := os.Getenv("repoId")
repoName := os.Getenv("repoName")