新增日志输出至本地文件 app.log

This commit is contained in:
2025-10-31 16:00:17 +08:00
parent 476489aeb9
commit 2e348b6352
4 changed files with 10 additions and 29 deletions

View File

@ -11,7 +11,9 @@ import (
)
func main() {
logger.LogInit()
file, _ := os.OpenFile("./app.log", os.O_CREATE|os.O_RDWR|os.O_APPEND, 0644)
defer file.Close()
logger.LogInit(file)
var conf Config.Object
if len(os.Args) == 1 || os.Args[1][0] == '-' {