From ec0421000f44f51bb95f1e9ddd2f5d007667253b Mon Sep 17 00:00:00 2001 From: iyear Date: Thu, 9 Apr 2020 15:54:19 +0800 Subject: [PATCH] Update --- control.go | 6 +++--- go.mod | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/control.go b/control.go index c3b6f1d..750537c 100644 --- a/control.go +++ b/control.go @@ -173,11 +173,11 @@ func GetAdmin() []int64 { return result } func InitLogger() { - if !PathExists("./log/") { - os.Mkdir("./log/", 0773) + if !PathExists(bLogBasePath) { + os.Mkdir(bLogBasePath, 0773) } - path := "./log/" + time.Now().Format("2006-01-02") + ".log" + path := bLogBasePath + time.Now().Format("2006-01-02") + ".log" f, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0773) if err != nil { logger.Println(err) diff --git a/go.mod b/go.mod index 665c492..772d1bd 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,6 @@ go 1.13 require ( github.com/fsnotify/fsnotify v1.4.7 github.com/go-sql-driver/mysql v1.5.0 - github.com/mitchellh/gox v1.0.1 // indirect github.com/robfig/cron/v3 v3.0.0 github.com/spf13/viper v1.6.2 github.com/tidwall/gjson v1.6.0