20template <std::
size_t MaxMessageLength = 256>
23 std::array<char, MaxMessageLength>
message{};
31 constexpr LogEventT(
LogLevel lvl, std::string_view msg,
const char* cat =
"App", uint64_t ts = 0) noexcept
40 std::size_t copyLen = msg.length() < (MaxMessageLength - 1) ? msg.length() : (MaxMessageLength - 1);
41 for (std::size_t i = 0; i < copyLen; ++i) {
49 [[nodiscard]]
constexpr std::string_view
view() const noexcept
Log severity enumeration and ANSI color formatting utilities.
Definition LogBackgroundService.hpp:17
LogLevel
Logging severity levels.
Definition LogLevel.hpp:14
Zero-heap log event carrying fixed-size inline message buffer across MPSC event bus.
Definition LogEvent.hpp:21
std::array< char, MaxMessageLength > message
Definition LogEvent.hpp:23
std::size_t length
Definition LogEvent.hpp:24
constexpr void setMessage(std::string_view msg) noexcept
Set inline message buffer safely up to MaxMessageLength - 1.
Definition LogEvent.hpp:38
constexpr LogEventT(LogLevel lvl, std::string_view msg, const char *cat="App", uint64_t ts=0) noexcept
Create log event with inline formatted string.
Definition LogEvent.hpp:31
const char * category
Definition LogEvent.hpp:25
uint64_t timestampNs
Definition LogEvent.hpp:26
LogLevel level
Definition LogEvent.hpp:22
constexpr std::string_view view() const noexcept
Access message as std::string_view.
Definition LogEvent.hpp:49
constexpr LogEventT()=default