From 0ec20b2fb10cf0191582a0591dfcb3dd643b1447 Mon Sep 17 00:00:00 2001 From: Lalit Date: Wed, 29 Sep 2021 21:41:13 -0700 Subject: [PATCH 1/3] logger api change --- api/include/opentelemetry/logs/logger.h | 17 +++++++++++++++++ sdk/include/opentelemetry/sdk/logs/logger.h | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/api/include/opentelemetry/logs/logger.h b/api/include/opentelemetry/logs/logger.h index 38b79e8bdf..f217b0ca68 100644 --- a/api/include/opentelemetry/logs/logger.h +++ b/api/include/opentelemetry/logs/logger.h @@ -189,6 +189,23 @@ class Logger this->Log(severity, name, "", {}, attributes, {}, {}, {}, std::chrono::system_clock::now()); } + /** + * Writes a log. + * @param severity The severity of the log + * @param name The name of the log + * @param attributes the attributes, stored as a 2D list of key/value pairs, that are associated + * with the log event + */ + void Log(Severity severity, + nostd::string_view name, + common::KeyValueIterable &attributes) noexcept + { + this->Log(severity, name, {}, + common::KeyValueIterableView< + std::initializer_list>>({}), + attributes, {}, {}, {}, std::chrono::system_clock::now()); + } + /** Trace severity overloads **/ /** diff --git a/sdk/include/opentelemetry/sdk/logs/logger.h b/sdk/include/opentelemetry/sdk/logs/logger.h index a1d758be4c..ca15372a11 100644 --- a/sdk/include/opentelemetry/sdk/logs/logger.h +++ b/sdk/include/opentelemetry/sdk/logs/logger.h @@ -52,8 +52,8 @@ class Logger final : public opentelemetry::logs::Logger nostd::string_view body, const opentelemetry::common::KeyValueIterable &resource, const opentelemetry::common::KeyValueIterable &attributes, - trace::TraceId trace_id, - trace::SpanId span_id, + opentelemetry::trace::TraceId trace_id, + opentelemetry::trace::SpanId span_id, trace::TraceFlags trace_flags, opentelemetry::common::SystemTimestamp timestamp) noexcept override; From d8b5789c3c0e1ca450f2d10d1eff7c3c9184f538 Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Wed, 29 Sep 2021 22:12:32 -0700 Subject: [PATCH 2/3] Update api/include/opentelemetry/logs/logger.h Co-authored-by: Tom Tan --- api/include/opentelemetry/logs/logger.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/include/opentelemetry/logs/logger.h b/api/include/opentelemetry/logs/logger.h index f217b0ca68..e615112b18 100644 --- a/api/include/opentelemetry/logs/logger.h +++ b/api/include/opentelemetry/logs/logger.h @@ -193,7 +193,7 @@ class Logger * Writes a log. * @param severity The severity of the log * @param name The name of the log - * @param attributes the attributes, stored as a 2D list of key/value pairs, that are associated + * @param attributes The attributes, stored as a 2D list of key/value pairs, that are associated * with the log event */ void Log(Severity severity, From 26da0ebe8b5b2c4da8a817acff951df1c4820b18 Mon Sep 17 00:00:00 2001 From: Lalit Date: Wed, 29 Sep 2021 23:48:24 -0700 Subject: [PATCH 3/3] remove explict inline keyword from member function within class definition --- api/include/opentelemetry/logs/logger.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/include/opentelemetry/logs/logger.h b/api/include/opentelemetry/logs/logger.h index f217b0ca68..a6af38b78b 100644 --- a/api/include/opentelemetry/logs/logger.h +++ b/api/include/opentelemetry/logs/logger.h @@ -143,7 +143,7 @@ class Logger */ template ::value> * = nullptr> - inline void Log(Severity severity, const T &attributes) noexcept + void Log(Severity severity, const T &attributes) noexcept { this->Log(severity, "", "", std::map{}, attributes, {}, {}, {}, std::chrono::system_clock::now()); @@ -157,7 +157,7 @@ class Logger */ template ::value> * = nullptr> - inline void Log(Severity severity, nostd::string_view name, const T &attributes) noexcept + void Log(Severity severity, nostd::string_view name, const T &attributes) noexcept { this->Log(severity, name, "", std::map{}, attributes, {}, {}, {}, std::chrono::system_clock::now());