24 #define QX_DEFINE_CATEGORY(name, ...) inline constexpr qx::category name = qx::category(QXT(#name), ##__VA_ARGS__)
32 #define QX_SET_FILE_CATEGORY(_category) \
34 struct qx::details::file_category<qx::djb2a_hash(QX_SHORT_FILE, 0)> \
36 static constexpr const qx::category& get() noexcept \
46 #define QX_GET_FILE_CATEGORY() qx::details::file_category<qx::djb2a_hash(QX_SHORT_FILE)>::get()
70 constexpr
bool operator==(
const category&)
const =
default;
78 constexpr
explicit category(string_view svName, std::optional<color> optCategoryColor = std::nullopt) noexcept;
92 constexpr string_view
get_name()
const noexcept;
109 string_view m_svName;
110 verbosity m_Verbosity = QX_CONF_COMPILE_TIME_VERBOSITY;
119 namespace qx::details
122 template<
size_t nHash>
125 static constexpr
const category& get() noexcept
133 template<
class char_t>
134 struct QX_FMT_NS::formatter<qx::category, char_t>
138 template<
class format_parse_context_t>
139 constexpr
auto parse(format_parse_context_t& ctx)
141 auto it = ctx.begin();
151 throw QX_FMT_NS::format_error(
"unknown spec");
156 template<
class format_context_type>
157 constexpr
auto format(
const qx::category& value, format_context_type& ctx)
const
161 if (value != CatDefault)
#define QX_DEFINE_CATEGORY(name,...)
Define a category.
A category is a class that identifies a particular piece of code. This code can be located in differe...
constexpr string_view get_name() const noexcept
Get category name.
constexpr category set_verbosity(verbosity eVerbosity) const noexcept
Create new category from this one with custom verbosity.
constexpr const color & get_color() const noexcept
Get category color.
constexpr verbosity get_verbosity() const noexcept
Get category verbosity.
#define QX_CHAR_PREFIX(value_t, ch)
Chose witch of prefixes add to char : L or none.
#define QX_STR_PREFIX(value_t, str)
Chose witch of prefixes add to string : L or none.