#include <userver/logging/log_extra.hpp>
Extra tskv fields storage.
Definition at line 36 of file log_extra.hpp.
Public Types | |
enum class | ExtendType { kNormal , kFrozen } |
Specifies replacement policy for newly added values. More... | |
using | Value |
using | Key = std::string |
using | Pair = std::pair<Key, Value> |
Public Member Functions | |
LogExtra (const LogExtra &) | |
LogExtra (LogExtra &&) | |
LogExtra & | operator= (LogExtra &&) |
LogExtra & | operator= (const LogExtra &) |
LogExtra (std::initializer_list< Pair > initial, ExtendType extend_type=ExtendType::kNormal) | |
Constructs LogExtra containing an initial batch of key-value pairs. | |
void | Extend (std::string key, Value value, ExtendType extend_type=ExtendType::kNormal) |
Adds a single key-value pair. | |
void | Extend (Pair extra, ExtendType extend_type=ExtendType::kNormal) |
Adds a single key-value pair. | |
void | Extend (std::initializer_list< Pair > extra, ExtendType extend_type=ExtendType::kNormal) |
Adds a batch of key-value pairs. | |
void | Extend (const LogExtra &extra) |
Merges contents of other LogExtra with existing key-value pairs preserving freeze states. | |
void | Extend (LogExtra &&extra) |
Merges contents of other LogExtra with existing key-value pairs preserving freeze states. | |
template<typename Iterator > | |
void | ExtendRange (Iterator first, Iterator last, ExtendType extend_type=ExtendType::kNormal) |
Adds a range of key-value pairs. | |
void | SetFrozen (const std::string &key) |
Marks specified value as frozen, all attempts to overwrite it will be silently ignored. | |
Static Public Member Functions | |
static LogExtra | StacktraceNocache () noexcept |
Creates a LogExtra with current thread's stacktrace if the default log level is less or equal to DEBUG. | |
static LogExtra | StacktraceNocache (logging::LoggerRef logger) noexcept |
Creates a LogExtra with current thread's stacktrace if the logger log level is less or equal to DEBUG. | |
static LogExtra | Stacktrace () noexcept |
Creates a LogExtra with current thread's stacktrace if the logger log level is less or equal to DEBUG. Uses cache for faster stacktrace symbolization. | |
static LogExtra | Stacktrace (logging::LoggerRef logger) noexcept |
Creates a LogExtra with current thread's stacktrace if the logger log level is less or equal to DEBUG. Uses cache for faster stacktrace symbolization. | |
using logging::LogExtra::Key = std::string |
Definition at line 40 of file log_extra.hpp.
using logging::LogExtra::Pair = std::pair<Key, Value> |
Definition at line 41 of file log_extra.hpp.
using logging::LogExtra::Value |
Definition at line 38 of file log_extra.hpp.
|
strong |
Specifies replacement policy for newly added values.
Enumerator | |
---|---|
kNormal | Added value can be replaced. |
kFrozen | Attempts to replace this value will be ignored. |
Definition at line 44 of file log_extra.hpp.
|
inline |
Adds a range of key-value pairs.
Definition at line 103 of file log_extra.hpp.
|
friend |
Definition at line 113 of file log_extra.hpp.
|
friend |
Definition at line 114 of file log_extra.hpp.