diff --git a/haivision/builder.go b/haivision/builder.go index 31ffd94..3af9301 100644 --- a/haivision/builder.go +++ b/haivision/builder.go @@ -15,6 +15,12 @@ func BuildHaivision(url string, debug bool, username string, password string, he Url: url, restClient: resty.New(), } + // + if debug { + haivisionClient.restClient.SetDebug(true) + haivisionClient.debug = true + log.Println("Debug mode is enabled for the haivision client ") + } // You can override all below settings and options at request level if you want to //-------------------------------------------------------------------------------- // Host URL for all request. So you can use relative URL in the request @@ -39,12 +45,6 @@ func BuildHaivision(url string, debug bool, username string, password string, he haivisionClient.restClient.SetHeader(h, v) } } - // - if debug { - haivisionClient.restClient.SetDebug(true) - haivisionClient.debug = true - log.Println("Debug mode is enabled for the haivision client ") - } return haivisionClient, nil }