13 #ifndef QX_CONF_COMPILE_TIME_VERBOSITY
14 #define QX_CONF_COMPILE_TIME_VERBOSITY qx::verbosity::detailed
37 constexpr
bool is_error(verbosity eVerbosity) noexcept
39 return eVerbosity == verbosity::error || eVerbosity == verbosity::critical;
44 template<
class char_t>
45 struct QX_FMT_NS::formatter<qx::verbosity, char_t>
49 template<
class format_parse_context_t>
50 constexpr
auto parse(format_parse_context_t& ctx)
52 auto it = ctx.begin();
62 throw QX_FMT_NS::format_error(
"unknown spec");
67 template<
class format_context_type>
68 constexpr
auto format(
const qx::verbosity& value, format_context_type& ctx)
const
70 auto get_log_name = [value]() -> basic_string_view<char_t>
74 case qx::verbosity::detailed:
76 case qx::verbosity::verbose:
78 case qx::verbosity::log:
80 case qx::verbosity::important:
82 case qx::verbosity::warning:
84 case qx::verbosity::error:
86 case qx::verbosity::critical:
88 case qx::verbosity::none:
95 auto get_full_name = [value]() -> basic_string_view<char_t>
99 case qx::verbosity::detailed:
101 case qx::verbosity::verbose:
103 case qx::verbosity::log:
105 case qx::verbosity::important:
107 case qx::verbosity::warning:
109 case qx::verbosity::error:
111 case qx::verbosity::critical:
113 case qx::verbosity::none:
120 return QX_FMT_NS::format_to(ctx.out(),
QX_STR_PREFIX(char_t,
"{}"), bLog ? get_log_name() : get_full_name());
#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.
constexpr bool is_error(verbosity eVerbosity) noexcept
Check if the verbosity level is an error.