48#include <sys/syslog.h>
75 static void log(value_ref<context_type> ctx,
const log_msg &msg)
noexcept;
89 const auto out = buffer.
as_sink();
90 if (!msg.logger_name.empty()) {
97 log(priority_for(msg.lvl),
"%.*s\n",
static_cast<int>(buffer.
view().size()), buffer.
view().data());
101 static int priority_for(
level lvl)
noexcept {
128inline logger &built_in_default_logger()
noexcept {
Output sink that stores formatted characters in an internal fixed-size stack/inline buffer.
Definition microfmt.hpp:185
constexpr microfmt::string_view view() const &noexcept RELOCO_LIFETIMEBOUND
Returns a string view over the characters written so far.
Definition microfmt.hpp:245
RELOCO_END_UNSAFE_BUFFER_USAGE RELOCO_CONSTEXPR20 sink as_sink() &noexcept RELOCO_LIFETIMEBOUND
Creates a type-erased sink adapter pointing to this instance.
Definition microfmt.hpp:236
Adapter that writes structured records to the FreeBSD kernel's log(9).
Definition default_log_sink.template.hpp:79
void log_impl(const log_msg &msg) noexcept
Definition default_log_sink.template.hpp:83
log_sink as_sink() noexcept RELOCO_LIFETIMEBOUND
Definition default_log_sink.template.hpp:81
Type-erased, two-word handle to a log sink backend, plus the severity threshold below which records a...
Definition sink.hpp:73
Definition default_log_sink.template.hpp:51
level
Shared log severity levels in ascending order.
Definition log_msg.hpp:22
RELOCO_CONSTEXPR20 void format_to(const sink &out, microfmt::string_view fmt, const Args &...args) noexcept
Definition microfmt.hpp:1766
Tag selecting kernel_log_sink as a log_sink backend.
Definition default_log_sink.template.hpp:70
Structured log record forwarded by a logger to each sink.
Definition log_msg.hpp:69
Static customization point describing a log sink backend.
Definition sink.hpp:46