fix: 无法写日志文件的问题

This commit is contained in:
Mmx233
2022-08-15 23:49:37 +08:00
parent ad36fc3582
commit 4de55dcbb8

View File

@@ -5,6 +5,7 @@ import (
"io"
"os"
"strings"
"time"
)
func initLog() {
@@ -21,7 +22,7 @@ func initLog() {
log.Fatalln(e)
}
f, e := os.OpenFile(Config.Settings.Debug.LogPath, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 700)
f, e := os.OpenFile(Config.Settings.Debug.LogPath+time.Now().Format("2006.01.02-15.04.05")+".log", os.O_WRONLY|os.O_CREATE|os.O_APPEND, 700)
if e != nil {
log.Fatalln(e)
}