增加默认日志文件路径与文件名

This commit is contained in:
2021-04-17 23:18:58 +08:00
parent 267fdf1a4c
commit 551da36ac9
2 changed files with 7 additions and 0 deletions

View File

@ -80,6 +80,10 @@ func SetWSServerLogEnable(logPath string, logFile string, logLevel zapcore.Level
// 传入非法值,默认按小时切割日志
splitInterval = DefaultLogSplitInterval
}
if len(logPath) == 0 {
logPath = "./logs"
}
wsc.LogEnable = true
wsc.LogPath = logPath
wsc.LogFile = logFile