add a unified logging handler to the http client

This commit is contained in:
MaysWind
2026-01-15 23:29:48 +08:00
parent 853b0d430e
commit 89fb8a099e
18 changed files with 130 additions and 48 deletions
+7
View File
@@ -305,6 +305,7 @@ type Config struct {
EnableConsoleLog bool
EnableFileLog bool
EnableDebugLog bool
LogLevel Level
FileLogPath string
RequestFileLogPath string
@@ -759,6 +760,12 @@ func loadLogConfiguration(config *Config, configFile *ini.File, sectionName stri
return errs.ErrInvalidLogLevel
}
if config.LogLevel == LOGLEVEL_DEBUG {
config.EnableDebugLog = true
} else {
config.EnableDebugLog = false
}
if config.EnableFileLog {
fileLogPath := getConfigItemStringValue(configFile, sectionName, "log_path")
finalFileLogPath, _ := getFinalPath(config.WorkingPath, fileLogPath)