This commit is contained in:
flswld committed 2023-10-18 23:30:16 +08:00
1 parent e08e9579bd
commit ab16df5cb6
5 files changed
+92 -5

No files matched your search

+1 -1
View File
@@ -131,7 +131,7 @@ func (l *Logger) writeLogFile(logStr string) {
logStr = strings.ReplaceAll(logStr, v, "")
}
if l.File == nil {
file, err := os.OpenFile("./"+l.AppName+".log", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644)
file, err := os.OpenFile("./log/"+l.AppName+".log", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644)
if err != nil {
fmt.Printf(RED+"open new log file error: %v\n"+RESET, err)
return