Extra tskv fields storage. More...
#include <userver/logging/log_extra.hpp>
Public Types | |
| enum class | ExtendType {  kNormal , kFrozen }  | 
| Specifies replacement policy for newly added values.  More... | |
| using | Value = std::variant< std::string, int, long, long long, unsigned int, unsigned long, unsigned long long, float, double > | 
| 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.  | |
Friends | |
| class | tracing::Span | 
Extra tskv fields storage.
Definition at line 32 of file log_extra.hpp.
| using logging::LogExtra::Key = std::string | 
Definition at line 36 of file log_extra.hpp.
| using logging::LogExtra::Pair = std::pair<Key, Value> | 
Definition at line 37 of file log_extra.hpp.
| using logging::LogExtra::Value = std::variant<std::string, int, long, long long, unsigned int, unsigned long, unsigned long long, float, double> | 
Definition at line 34 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 40 of file log_extra.hpp.
      
  | 
  inline | 
Adds a range of key-value pairs.
Definition at line 102 of file log_extra.hpp.
      
  | 
  friend | 
Definition at line 113 of file log_extra.hpp.