microfmt
Zero-allocation C++ formatting for constrained environments
Loading...
Searching...
No Matches
Classes | Namespaces
tagged_log_sink_base.hpp File Reference

Shared base for log sink backends that tag each record with a fixed-capacity, null-terminated string (e.g. Android logcat's tag, Tizen DLOG's tag). More...

#include "../../microfmt.hpp"
#include <cstddef>
#include <string_view>
Include dependency graph for tagged_log_sink_base.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  microfmt::log::detail::tagged_log_sink_base< TagCapacity >
 CRTP-free base providing fixed-capacity tag storage and truncating tag resolution, shared by tag-per-record log sink backends. More...
 

Namespaces

namespace  microfmt
 
namespace  microfmt::log
 
namespace  microfmt::log::detail
 Fixed-capacity logger that formats records before dispatching to sinks.
 

Detailed Description

Shared base for log sink backends that tag each record with a fixed-capacity, null-terminated string (e.g. Android logcat's tag, Tizen DLOG's tag).

Every such backend needs the exact same two things: a truncating set_tag() that copies a caller-supplied default tag into fixed storage, and a per-record resolve_tag() that prefers the originating logger's own name (also truncated into a caller-supplied scratch buffer) so records from different loggers stay distinguishable in platform log filters, falling back to the sink's configured default tag when the record carries none. Factoring both into tagged_log_sink_base keeps that logic (and its RELOCO_UNSAFE_BUFFER_USAGE bookkeeping) written and reviewed exactly once.