Proper log rotation, filename compatibility with windows
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
netHttp "net/http"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
// _ "net/http/pprof" // Register pprof
|
||||
@@ -31,10 +30,7 @@ func MainApp(configPath string) {
|
||||
utils.EnsureDirExists("data/info")
|
||||
utils.EnsureDirExists("dump") // "zurgtorrent" files
|
||||
|
||||
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)
|
||||
log := logutil.NewLogger("logs/zurg.log")
|
||||
|
||||
zurglog := log.Named("zurg") // logger for this main function
|
||||
|
||||
|
||||
Reference in New Issue
Block a user