18inline constexpr std::uint32_t
no_cpu = 0xFFFFFFFFU;
34 static constexpr unsigned user_flags_shift = 16;
39 std::uint32_t flags{0};
41 [[nodiscard]]
constexpr bool has(
log_flag f)
const noexcept {
return (flags &
static_cast<std::uint32_t
>(f)) != 0; }
42 [[nodiscard]]
constexpr bool can_wait() const noexcept {
return has(log_flag::can_wait); }
45 [[nodiscard]]
constexpr std::uint32_t
user_flags() const noexcept {
return flags >> user_flags_shift; }
49 flags = (flags & 0xFFFFU) | ((user & 0xFFFFU) << user_flags_shift);
53 const auto bit =
static_cast<std::uint32_t
>(f);
54 flags = on ? (flags | bit) : (flags & ~bit);
#define MICROFMT_API_CLASS
Definition compat.hpp:181
RELOCO_TYPE_ID_NAME(microfmt::log::extended_log_msg, "microfmt::log::extended_log_msg")
Structured log-record types and severity levels.
Definition default_log_sink.template.hpp:51
constexpr std::uint32_t no_cpu
CPU index value meaning "unknown".
Definition extended_msg.hpp:18
log_flag
Well-known bits of log_meta::flags. Bits 16..31 belong to the user.
Definition extended_msg.hpp:21
log_msg plus log_meta. Derives from the original record, so it converts to const log_msg & anywhere t...
Definition extended_msg.hpp:62
constexpr extended_log_msg()=default
constexpr extended_log_msg(const log_msg &base, const log_meta &m={}) noexcept
Definition extended_msg.hpp:66
Structured log record forwarded by a logger to each sink.
Definition log_msg.hpp:69