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`.
This commit is contained in:
parent
d5889bff8b
commit
774a10bbeb
@ -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…
Reference in New Issue
Block a user