mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-27 02:10:40 +00:00
bug fixed
This commit is contained in:
parent
9b509054cf
commit
1284d99fd2
1 changed files with 12 additions and 10 deletions
22
update.go
22
update.go
|
@ -5,10 +5,10 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"os"
|
"os"
|
||||||
"github.com/codegangsta/cli"
|
"github.com/codegangsta/cli"
|
||||||
"github.com/gogits/gogs/modules/log"
|
//"github.com/gogits/gogs/modules/log"
|
||||||
|
"github.com/qiniu/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
var CmdUpdate = cli.Command{
|
var CmdUpdate = cli.Command{
|
||||||
|
@ -22,16 +22,18 @@ gogs serv provide access auth for repositories`,
|
||||||
|
|
||||||
// for command: ./gogs update
|
// for command: ./gogs update
|
||||||
func runUpdate(c *cli.Context) {
|
func runUpdate(c *cli.Context) {
|
||||||
level := "0"
|
//level := "0"
|
||||||
os.MkdirAll("log", os.ModePerm)
|
//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, "log/serv.log"))
|
||||||
log.Info("start update logging...")
|
//log.Info("start update logging...")
|
||||||
|
|
||||||
//w, _ := os.Create("update.log")
|
w, _ := os.Create("update.log")
|
||||||
//log.SetOutput(w)
|
defer w.Close()
|
||||||
|
|
||||||
|
log.SetOutput(w)
|
||||||
for i, arg := range c.Args() {
|
for i, arg := range c.Args() {
|
||||||
log.Info("%d : %s", i, arg)
|
log.Info(i, arg)
|
||||||
}
|
}
|
||||||
/*userName := os.Getenv("userName")
|
/*userName := os.Getenv("userName")
|
||||||
userId := os.Getenv("userId")
|
userId := os.Getenv("userId")
|
||||||
repoId := os.Getenv("repoId")
|
repoId := os.Getenv("repoId")
|
||||||
|
|
Loading…
Reference in a new issue