add a unified logging handler to the http client
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user