13#if __cplusplus >= 201703L
63 template<
typename char_t>
69#if __cplusplus >= 201703L
81 if (nLevel >
Level::FATAL)
return std::basic_string<char_t>{};
82#if __cplusplus >= 201703L
83 return std::basic_string<char_t>{
NAMES[
static_cast<std::size_t
>(nLevel)]};
85 const auto sData = getNameView14(nLevel);
86 return {sData.data(), sData.length()};
90#if __cplusplus >= 201703L
97 if (nLevel >
Level::FATAL)
return std::basic_string_view<char_t>{};
98 return NAMES[
static_cast<std::size_t
>(nLevel)];
102 constexpr static std::array<string_view_type, 9>
NAMES = {
151#if __cplusplus >= 202002L
186 template<
typename char_t>
193#if __cplusplus >= 201703L
208#if __cplusplus >= 202002L
243 template<
typename char_t>
Root namespace for the CppTrail logging library.
Definition async_logger.h:24
std::string_view getNameView(const Level nLevel)
Gets a view of the level name.
Definition def.h:204
std::u16string u16getName(const Level nLevel)
Gets the level name as a std::u16string.
Definition def.h:167
std::u16string_view u16getNameView(const Level nLevel)
Gets a UTF-16 view of the level name.
Definition def.h:224
Level
Severity levels for log entries.
Definition def.h:42
@ WARNING
Indications of potential issues or non-critical failures.
@ FATAL
Terminal errors that require immediate application termination.
@ TRACE
Extremely fine-grained diagnostic events (wire-level).
@ INFO
General operational messages about application progress.
@ MESSAGE
High-level communication or protocol-specific messages.
@ CRITICAL
Severe failures that may lead to localized component shutdown.
@ ERROR
Significant issues that require attention but allow continued execution.
@ SUCCESS
Positive confirmation of a successful operation.
@ DEBUG
Information useful for application debugging.
std::u8string_view u8getNameView(const Level nLevel)
Gets a UTF-8 view of the level name.
Definition def.h:214
std::u32string u32getName(const Level nLevel)
Gets the level name as a std::u32string.
Definition def.h:176
std::string getName(const Level nLevel)
Gets the level name as a std::string.
Definition def.h:147
std::u32string_view u32getNameView(const Level nLevel)
Gets a UTF-32 view of the level name.
Definition def.h:233
std::basic_string< char_t > tgetName(const Level nLevel)
Template version for generic character types (allocating).
Definition def.h:187
std::basic_string_view< char_t > tgetNameView(const Level nLevel)
Template version for generic character types (non-allocating).
Definition def.h:244
std::u8string u8getName(const Level nLevel)
Gets the level name as a std::u8string.
Definition def.h:157
Status
Represents the current operational state of a Logger implementation.
Definition def.h:31
@ TRASCENDENT
The logger operates outside standard lifecycle management.
@ STOPPED
The logger has been gracefully shut down.
@ BROKEN
The logger encountered a fatal error (e.g., IO failure).
@ RUNNING
The logger is active and processing entries.
Internal implementation details. Not intended for direct public use.
std::basic_string_view< char_t > basic_string_view
String view type for poly_enc.
Definition utf42.h:179
Template utility to map Level enums to string representations.
Definition def.h:64
std::basic_string_view< char_t > string_view_type
Maps to std::string_view on C++17+, or CppTrail's fallback view on older standards.
Definition def.h:70
static std::basic_string_view< char_t > getNameView(Level nLevel) noexcept
Retrieves a view of the level name.
Definition def.h:96
static constexpr std::array< string_view_type, 9 > NAMES
Static array of localized/encoded level names.
Definition def.h:102
static std::basic_string< char_t > getName(Level nLevel)
Retrieves the level name as a basic_string.
Definition def.h:80
Compile-time polymorphic string literal selection across character encodings.
#define make_poly_enc(char_t, lit)
Creates a compile-time polymorphic encoded string literal.
Definition utf42.h:80