Update
This commit is contained in:
parent
2540e7524a
commit
ec0421000f
@ -173,11 +173,11 @@ func GetAdmin() []int64 {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
func InitLogger() {
|
func InitLogger() {
|
||||||
if !PathExists("./log/") {
|
if !PathExists(bLogBasePath) {
|
||||||
os.Mkdir("./log/", 0773)
|
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)
|
f, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0773)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Println(err)
|
logger.Println(err)
|
||||||
|
|||||||
1
go.mod
1
go.mod
@ -5,7 +5,6 @@ go 1.13
|
|||||||
require (
|
require (
|
||||||
github.com/fsnotify/fsnotify v1.4.7
|
github.com/fsnotify/fsnotify v1.4.7
|
||||||
github.com/go-sql-driver/mysql v1.5.0
|
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/robfig/cron/v3 v3.0.0
|
||||||
github.com/spf13/viper v1.6.2
|
github.com/spf13/viper v1.6.2
|
||||||
github.com/tidwall/gjson v1.6.0
|
github.com/tidwall/gjson v1.6.0
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user