39 entry.
location->function.to_string(),
60template <
typename Container>
71 std::size_t max_queue_size,
145 template <
typename T>
147 return container.size();
153 template <
typename T>
155 return container.size();
161 template <
typename T>
169 template <
typename T>
Abstract base class for decorator pattern log writers.
const std::string & decorator_name() const noexcept
Get the decorator name.
log_writer_interface & wrapped() noexcept
Access the wrapped writer (non-const)
virtual bool is_healthy() const =0
Check if the writer is healthy.
Abstract base class for queue-based log writers.
std::atomic< bool > shutting_down_
virtual common::VoidResult handle_overflow(const log_entry &)
Handle queue overflow condition.
virtual void on_entry_enqueued()
Called after an entry is successfully enqueued.
std::size_t get_queue_size() const
Get the current queue size.
common::VoidResult try_enqueue(const log_entry &entry)
Try to enqueue an entry with overflow protection.
std::size_t max_queue_size_
~queued_writer_base() override=default
Virtual destructor.
bool is_healthy() const override
Check if the writer is healthy.
static void enqueue_entry(std::vector< T > &container, const log_entry &entry)
Enqueue entry (specialization for std::vector)
static std::size_t get_container_size(const std::queue< T > &container)
Get container size (specialization for std::queue)
static void enqueue_entry(std::queue< T > &container, const log_entry &entry)
Enqueue entry (specialization for std::queue)
std::size_t get_max_queue_size() const
Get maximum queue size.
static std::size_t get_container_size(const std::vector< T > &container)
Get container size (specialization for std::vector)
queued_writer_base(std::unique_ptr< log_writer_interface > wrapped_writer, std::size_t max_queue_size, std::string_view decorator_name)
Constructor for queued writer base.
std::string to_string() const
Convert to std::string.
Base class for decorator pattern writers.
Data structures for representing log entries and source locations kcenon.
common::VoidResult make_logger_void_result(logger_error_code code, const std::string &message="")
log_entry copy_log_entry(const log_entry &entry)
Creates a copy of a log_entry for queue storage.
Tag interface for asynchronous writers.
Represents a single log entry with all associated metadata.
std::optional< source_location > location
Optional source code location information.
log_level level
Severity level of the log message.
small_string_256 message
The actual log message.
std::chrono::system_clock::time_point timestamp
Timestamp when the log entry was created.
Writer category interfaces and type traits kcenon.