Logger System 0.1.3
High-performance C++20 thread-safe logging system with asynchronous capabilities
Loading...
Searching...
No Matches
unified_log_context.h File Reference

Unified interface for managing all types of logging context. More...

#include <kcenon/logger/interfaces/log_entry.h>
#include <kcenon/logger/logger_export.h>
#include <kcenon/logger/otlp/otel_context.h>
#include <optional>
#include <shared_mutex>
#include <string>
#include <string_view>
#include <unordered_map>
#include <variant>
#include <vector>
Include dependency graph for unified_log_context.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  kcenon::logger::unified_log_context
 Unified interface for managing all types of logging context. More...
 
struct  kcenon::logger::unified_log_context::entry
 Internal entry structure. More...
 

Namespaces

namespace  kcenon
 
namespace  kcenon::logger
 

Typedefs

using kcenon::logger::context_value = std::variant<std::monostate, bool, int64_t, double, std::string>
 Value type for unified context storage.
 

Enumerations

enum class  kcenon::logger::context_category : uint8_t { kcenon::logger::custom = 0 , kcenon::logger::trace = 1 , kcenon::logger::request = 2 , kcenon::logger::otel = 3 }
 Categories for organizing context entries. More...
 

Detailed Description

Unified interface for managing all types of logging context.

Author
kcenon
Since
3.3.0

This file provides the unified_log_context class that consolidates all logging context management into a single, thread-safe interface. It replaces the previous scattered approach of managing context through separate mechanisms (log_context_storage, otel_context_storage, etc.).

Key Features:

  • Single unified storage for all context types
  • Thread-safe operations with shared mutex
  • Category-based context organization
  • Type-safe value storage using std::variant

Definition in file unified_log_context.h.