Skip to content

Commit 8ef6b92

Browse files
authored
Merge pull request #86 from deploymenttheory/dev
Dev
2 parents 078b0fe + 2d7ca5e commit 8ef6b92

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

httpclient/httpclient_client.go

+2-15
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ like the baseURL, authentication details, and an embedded standard HTTP client.
88
package httpclient
99

1010
import (
11-
"log"
1211
"net/http"
1312
"sync"
1413
"time"
@@ -83,23 +82,11 @@ type PerformanceMetrics struct {
8382
}
8483

8584
// BuildClient creates a new HTTP client with the provided configuration.
86-
func BuildClient(configFilePath string) (*Client, error) {
87-
88-
// Load the configuration
89-
config, err := SetClientConfiguration(configFilePath)
90-
if err != nil {
91-
log.Printf("Failed to set client configuration: %v", err) // This uses the standard log package before zap logger is initialized
92-
return nil, err
93-
}
85+
func BuildClient(config ClientConfig) (*Client, error) {
9486

9587
// Parse the log level string to logger.LogLevel
9688
parsedLogLevel := logger.ParseLogLevelFromString(config.ClientOptions.LogLevel)
9789

98-
// Set default value if none is provided
99-
if config.ClientOptions.LogConsoleSeparator == "" {
100-
config.ClientOptions.LogConsoleSeparator = ","
101-
}
102-
10390
// Initialize the logger with parsed config values
10491
log := logger.BuildLogger(parsedLogLevel, config.ClientOptions.LogOutputFormat, config.ClientOptions.LogConsoleSeparator)
10592

@@ -128,7 +115,7 @@ func BuildClient(configFilePath string) (*Client, error) {
128115
AuthMethod: authMethod,
129116
OverrideBaseDomain: config.Environment.OverrideBaseDomain,
130117
httpClient: &http.Client{Timeout: config.ClientOptions.CustomTimeout},
131-
clientConfig: *config,
118+
clientConfig: config,
132119
Logger: log,
133120
ConcurrencyMgr: NewConcurrencyManager(config.ClientOptions.MaxConcurrentRequests, log, true),
134121
PerfMetrics: PerformanceMetrics{},

0 commit comments

Comments
 (0)