refactor: config results path

This commit is contained in:
lilong.129
2025-06-15 22:55:02 +08:00
parent c62913ba1a
commit a78ba90d33
7 changed files with 113 additions and 38 deletions

View File

@@ -3,7 +3,6 @@ package hrp
import (
"io"
"os"
"path/filepath"
"runtime"
"strings"
"time"
@@ -65,8 +64,7 @@ func InitLogger(logLevel string, logJSON bool, logFile bool) {
}
// file writer - write to results/taskID/hrp.log
cfg := config.GetConfig()
logFilePath := filepath.Join(cfg.ResultsPath(), "hrp.log")
logFilePath := config.GetConfig().LogFilePath()
// create or open log file
logFileWriter, err := os.OpenFile(logFilePath, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0o666)