16 #ifndef QX_LOGGER_INSTANCE
17 #define QX_LOGGER_INSTANCE qx::logger_singleton::get_instance()
27 #define QX_LOG_C(category, eVerbosity, format, ...) \
29 .log(eVerbosity, format, category, QX_SHORT_FILE, qx::to_string(__FUNCTION__), QX_LINE, ##__VA_ARGS__)
38 #define QX_LOG(eVerbosity, format, ...) QX_LOG_C(CatDefault, eVerbosity, format, ##__VA_ARGS__)
43 template<
class... args_t>
44 concept log_acceptable_args = (
sizeof...(args_t) > 0 && format_acceptable_args<char_type, args_t...>);
71 string_view svFunction,
85 template<
class... args_t>
92 string_view svFunction,
105 void add_stream(std::unique_ptr<base_logger_stream> pStream) noexcept;
110 void reset() noexcept;
124 verbosity eVerbosity,
126 string_view svFunction) const noexcept;
Base class for logger streams.
A category is a class that identifies a particular piece of code. This code can be located in differe...
void log(verbosity eVerbosity, string_view svFormat, const category &category, string_view svFile, string_view svFunction, int nLine)
Log to all streams.
bool will_any_stream_accept(const category &category, verbosity eVerbosity, string_view svFile, string_view svFunction) const noexcept
Returns true if any of streams will accept this message.
void add_stream(std::unique_ptr< base_logger_stream > pStream) noexcept
Add output stream to the logger.
requires(log_acceptable_args< args_t... >) void log(verbosity eVerbosity
Log to all streams.
void reset() noexcept
Reset logger and clear all streams.
void flush()
Flush all streams.
#define QX_SINGLETON(T)
Simple Meyer's singleton.