51 using Value = std::variant<
63 using Key = std::string;
64 using Pair = std::pair<Key, Value>;
66 using ValueView = std::variant<
77 impl::JsonStringViewForInitializerList>;
79 using InitializerList = std::initializer_list<std::pair<std::string_view, ValueView>>;
89 LogExtra(
const LogExtra&);
97 LogExtra& operator=(LogExtra&&);
99 LogExtra& operator=(
const LogExtra&);
137 static LogExtra
Stacktrace(logging::LoggerRef logger)
noexcept;
140 template <
typename Iterator>
143 for (Iterator it = first; it != last; ++it) {
144 Extend(*it, extend_type);
152 friend class LogHelper;
153 friend class impl::LogExtraTskvFormatter;
154 friend class impl::TagWriter;
159 const Value& GetValue(std::string_view key)
const;
161 class ProtectedValue
final {
163 ProtectedValue() =
default;
164 ProtectedValue(Value value,
bool frozen);
165 ProtectedValue(
const ProtectedValue& other) =
default;
166 ProtectedValue(ProtectedValue&& other) =
default;
168 ProtectedValue& operator=(
const ProtectedValue& other);
169 ProtectedValue& operator=(ProtectedValue&& other)
noexcept;
171 bool IsFrozen()
const;
173 Value& GetValue() {
return value_; }
174 const Value& GetValue()
const {
return value_; }
175 void AssignIgnoringFrozenness(ProtectedValue other);
179 bool frozen_ =
false;
182 static constexpr std::size_t kSmallVectorSize = 24;
183 static constexpr std::size_t kPimplSize =
184 compiler::SelectSize().ForLibCpp32(1168).ForLibCpp64(1560).ForLibStdCpp64(1944).ForLibStdCpp32(1356);
185 using MapItem = std::pair<Key, ProtectedValue>;
186 using Map = boost::container::small_vector<MapItem, kSmallVectorSize>;
192 std::pair<Key, ProtectedValue>* Find(std::string_view);
194 const std::pair<Key, ProtectedValue>* Find(std::string_view)
const;
196 utils::FastPimpl<Map, kPimplSize,
alignof(
void*)> extra_;