Attributes proper insertion overloads.

Previous functions were named poorly due to miscommunication between the devs.

All functions to put attributes on a logger are `put`.
pull/3128/head
Felix Heitmann 1 year ago committed by M4rFri
parent d468e32a88
commit 9d708f921a
No known key found for this signature in database

@ -16,23 +16,20 @@ public:
using const_iter = attr_map_t::const_iterator; using const_iter = attr_map_t::const_iterator;
log_attributes() = default; log_attributes() = default;
log_attributes(const log_attributes& other) { log_attributes(const log_attributes& other) { put(other.get_map()); }
const auto& o_map = other.get_map();
attr_ctx(o_map.begin(), o_map.end());
}
log_attributes& operator=(const log_attributes& other) { log_attributes& operator=(const log_attributes& other) {
if (this != &other) { if (this != &other) {
clear(); clear();
const auto& o_map = other.get_map(); put(other.get_map());
attr_ctx(o_map.begin(), o_map.end());
} }
return *this; return *this;
} }
void put(const key_t& key, const value_t& value) { void put(attr_map_t const& attributes) {
auto lck = lock(); auto lck = lock();
attrs[key] = value; attrs.insert(attributes.begin(), attributes.end());
} }
void put(const key_t& key, const value_t& value) { put({{key, value}}); }
void remove(const key_t& key) { void remove(const key_t& key) {
auto lck = lock(); auto lck = lock();

Loading…
Cancel
Save