Skip to content

Commit

Permalink
fix: fix logger file name
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerome Le Saux committed Apr 2, 2024
1 parent 7c8d382 commit 9d0e6df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion log/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"log"
"os"
"path/filepath"
"strings"
"time"
)

Expand Down Expand Up @@ -100,7 +101,7 @@ func InitLoggerWithFile(prefix string) (*MLogger, error) {
if err != nil {
return nil, err
}
file := fmt.Sprintf(dir+string(filepath.Separator)+"%s %s.log", prefix, now.Format(time.DateTime))
file := fmt.Sprintf(dir+string(filepath.Separator)+"%s %s.log", prefix, strings.ReplaceAll(now.Format(time.DateTime), ":", " "))
writer, err := os.Create(file)
if err != nil {
return nil, err
Expand Down

0 comments on commit 9d0e6df

Please sign in to comment.