Skip to content

Commit

Permalink
Fix debug log of OTLP HTTP exporter and ES log exporter (open-telemet…
Browse files Browse the repository at this point in the history
  • Loading branch information
owent authored and yxue committed Dec 5, 2022
1 parent 4dcb8da commit 8e6ad8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions exporters/elasticsearch/src/es_log_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ class ResponseHandler : public http_client::EventHandler
const std::string &body) noexcept
{
std::stringstream ss;
ss << "Status:" << response.GetStatusCode() << "Header:";
ss << "Status:" << response.GetStatusCode() << ", Header:";
response.ForEachHeader([&ss](opentelemetry::nostd::string_view header_name,
opentelemetry::nostd::string_view header_value) {
ss << "\t" << header_name.data() << " : " << header_value.data() << ",";
ss << "\t" << header_name.data() << ": " << header_value.data() << ",";
return true;
});
ss << "Body:" << body;
Expand Down
7 changes: 3 additions & 4 deletions exporters/otlp/src/otlp_http_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ class ResponseHandler : public http_client::EventHandler
const std::string &body) noexcept
{
std::stringstream ss;
ss << "Status:" << response.GetStatusCode() << "Header:";
ss << "Status:" << response.GetStatusCode() << ", Header:";
response.ForEachHeader([&ss](opentelemetry::nostd::string_view header_name,
opentelemetry::nostd::string_view header_value) {
ss << "\t" << header_name.data() << " : " << header_value.data() << ",";
ss << "\t" << header_name.data() << ": " << header_value.data() << ",";
return true;
});
ss << "Body:" << body;
Expand Down Expand Up @@ -116,8 +116,7 @@ class ResponseHandler : public http_client::EventHandler
OTEL_INTERNAL_LOG_ERROR("OTLP HTTP Client] Export failed, " << log_message);
result = sdk::common::ExportResult::kFailure;
}

if (console_debug_)
else if (console_debug_)
{
if (log_message.empty())
{
Expand Down

0 comments on commit 8e6ad8c

Please sign in to comment.