Fix log filename issue on Windows
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
netHttp "net/http"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
// _ "net/http/pprof" // Register pprof
|
||||
@@ -30,7 +31,9 @@ func MainApp(configPath string) {
|
||||
utils.EnsureDirExists("data/info")
|
||||
utils.EnsureDirExists("dump") // "zurgtorrent" files
|
||||
|
||||
logPath := fmt.Sprintf("logs/zurg-%s-%s.log", time.Now().Format(time.DateOnly), time.Now().Format(time.TimeOnly))
|
||||
dateStr := time.Now().Format(time.DateOnly)
|
||||
timeStr := strings.ReplaceAll(time.Now().Format(time.TimeOnly), ":", "-")
|
||||
logPath := fmt.Sprintf("logs/zurg-%s-%s.log", dateStr, timeStr)
|
||||
log := logutil.NewLogger(logPath)
|
||||
|
||||
zurglog := log.Named("zurg") // logger for this main function
|
||||
|
||||
Reference in New Issue
Block a user