Skip to content

Commit

Permalink
Align with naming conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
chusitoo committed Nov 2, 2024
1 parent d0b8589 commit 5dc28ab
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class Request : public opentelemetry::ext::http::client::Request
compression_ = compression;
}

void EnableLogging(bool needs_to_log) noexcept override { needs_to_log_ = needs_to_log; }
void EnableLogging(bool is_log_enabled) noexcept override { is_log_enabled_ = is_log_enabled; }

public:
opentelemetry::ext::http::client::Method method_;
Expand All @@ -113,7 +113,7 @@ class Request : public opentelemetry::ext::http::client::Request
std::chrono::milliseconds timeout_ms_{5000}; // ms
opentelemetry::ext::http::client::Compression compression_{
opentelemetry::ext::http::client::Compression::kNone};
bool needs_to_log_{false};
bool is_log_enabled_{false};
};

class Response : public opentelemetry::ext::http::client::Response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class HttpOperation
bool is_raw_response = false,
std::chrono::milliseconds http_conn_timeout = default_http_conn_timeout,
bool reuse_connection = false,
bool needs_to_log = false);
bool is_log_enabled = false);

/**
* Destroy CURL instance
Expand Down Expand Up @@ -307,7 +307,7 @@ class HttpOperation

const opentelemetry::ext::http::client::Compression &compression_;

const bool needs_to_log_;
const bool is_log_enabled_;

// Processed response headers and body
long response_code_;
Expand Down
2 changes: 1 addition & 1 deletion ext/include/opentelemetry/ext/http/client/http_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ class Request

virtual void SetCompression(const Compression &compression) noexcept = 0;

virtual void EnableLogging(bool needs_to_log) noexcept = 0;
virtual void EnableLogging(bool is_log_enabled) noexcept = 0;

virtual ~Request() = default;
};
Expand Down
2 changes: 1 addition & 1 deletion ext/src/http/client/curl/http_client_curl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void Session::SendRequest(
curl_operation_.reset(new HttpOperation(
http_request_->method_, url, http_request_->ssl_options_, callback_ptr,
http_request_->headers_, http_request_->body_, http_request_->compression_, false,
http_request_->timeout_ms_, reuse_connection, http_request_->needs_to_log_));
http_request_->timeout_ms_, reuse_connection, http_request_->is_log_enabled_));
bool success =
CURLE_OK == curl_operation_->SendAsync(this, [this, callback](HttpOperation &operation) {
if (operation.WasAborted())
Expand Down
6 changes: 3 additions & 3 deletions ext/src/http/client/curl/http_operation_curl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ HttpOperation::HttpOperation(opentelemetry::ext::http::client::Method method,
bool is_raw_response,
std::chrono::milliseconds http_conn_timeout,
bool reuse_connection,
bool needs_to_log)
bool is_log_enabled)
: is_aborted_(false),
is_finished_(false),
is_cleaned_(false),
Expand All @@ -283,7 +283,7 @@ HttpOperation::HttpOperation(opentelemetry::ext::http::client::Method method,
request_nwrite_(0),
session_state_(opentelemetry::ext::http::client::SessionState::Created),
compression_(compression),
needs_to_log_(needs_to_log),
is_log_enabled_(is_log_enabled),
response_code_(0)
{
/* get a curl handle */
Expand Down Expand Up @@ -658,7 +658,7 @@ CURLcode HttpOperation::Setup()
return rc;
}
#else
rc = SetCurlLongOption(CURLOPT_VERBOSE, static_cast<long>(needs_to_log_ || kEnableCurlLogging));
rc = SetCurlLongOption(CURLOPT_VERBOSE, static_cast<long>(is_log_enabled_ || kEnableCurlLogging));
if (rc != CURLE_OK)
{
return rc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class Request : public opentelemetry::ext::http::client::Request
compression_ = compression;
}

void EnableLogging(bool needs_to_log) noexcept override { needs_to_log_ = needs_to_log; }
void EnableLogging(bool is_log_enabled) noexcept override { is_log_enabled_ = is_log_enabled; }

public:
opentelemetry::ext::http::client::Method method_;
Expand All @@ -80,7 +80,7 @@ class Request : public opentelemetry::ext::http::client::Request
std::chrono::milliseconds timeout_ms_{5000}; // ms
opentelemetry::ext::http::client::Compression compression_{
opentelemetry::ext::http::client::Compression::kNone};
bool needs_to_log_{false};
bool is_log_enabled_{false};
};

class Response : public opentelemetry::ext::http::client::Response
Expand Down

0 comments on commit 5dc28ab

Please sign in to comment.