Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions api/include/opentelemetry/logs/logger_type_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#pragma once

#include <chrono>
#include <memory>
#include <type_traits>

#include "opentelemetry/common/attribute_value.h"
Expand Down Expand Up @@ -145,6 +146,10 @@ struct LogRecordSetterTrait<common::KeyValueIterable>
template <class ValueType>
struct LogRecordSetterTrait
{
static_assert(!std::is_same<nostd::unique_ptr<LogRecord>, ValueType>::value &&
!std::is_same<std::unique_ptr<LogRecord>, ValueType>::value,
"unique_ptr<LogRecord> is not allowed");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"unique_ptr<LogRecord> is not allowed");
"unique_ptr<LogRecord> is not allowed, use std::move()");

Also, consider adding an assert for LogRecord*

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, it's done


template <class ArgumentType,
nostd::enable_if_t<std::is_convertible<ArgumentType, nostd::string_view>::value ||
std::is_convertible<ArgumentType, common::AttributeValue>::value,
Expand Down