32 #undef SPDLOG_ACTIVE_LEVEL
33 #define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_TRACE
34 #include <spdlog/spdlog.h>
37 #include "core/GpgFrontendCoreExport.h"
40 struct fmt::formatter<QString> {
42 constexpr
auto parse(format_parse_context& ctx) -> decltype(ctx.begin()) {
47 template <
typename FormatContext>
48 auto format(
const QString& qstr, FormatContext& ctx)
const
49 -> decltype(ctx.out()) {
52 QByteArray utf8_array = qstr.toUtf8();
53 return fmt::format_to(ctx.out(),
"{}", utf8_array.constData());
58 struct fmt::formatter<QByteArray> {
60 constexpr
auto parse(format_parse_context& ctx) -> decltype(ctx.begin()) {
65 template <
typename FormatContext>
66 auto format(
const QByteArray& qarray, FormatContext& ctx)
const
67 -> decltype(ctx.out()) {
70 return fmt::format_to(ctx.out(),
"{}", qarray.constData());
82 -> std::shared_ptr<spdlog::logger>;
89 auto GPGFRONTEND_CORE_EXPORT
GetCoreLogger() -> std::shared_ptr<spdlog::logger>;
96 auto GPGFRONTEND_CORE_EXPORT
GetLogger(
const QString&)
97 -> std::shared_ptr<spdlog::logger>;
112 spdlog::level::level_enum);
120 spdlog::level::level_enum);
124 #define GF_DEFAULT_LOG_TRACE(...) \
125 SPDLOG_LOGGER_TRACE(GpgFrontend::GetDefaultLogger(), __VA_ARGS__)
126 #define GF_DEFAULT_LOG_DEBUG(...) \
127 SPDLOG_LOGGER_DEBUG(GpgFrontend::GetDefaultLogger(), __VA_ARGS__)
128 #define GF_DEFAULT_LOG_INFO(...) \
129 SPDLOG_LOGGER_INFO(GpgFrontend::GetDefaultLogger(), __VA_ARGS__)
130 #define GF_DEFAULT_LOG_WARN(...) \
131 SPDLOG_LOGGER_WARN(GpgFrontend::GetDefaultLogger(), __VA_ARGS__)
132 #define GF_DEFAULT_LOG_ERROR(...) \
133 SPDLOG_LOGGER_ERROR(GpgFrontend::GetDefaultLogger(), __VA_ARGS__)
135 #define GF_CORE_LOG_TRACE(...) \
136 SPDLOG_LOGGER_TRACE(GpgFrontend::GetCoreLogger(), __VA_ARGS__)
137 #define GF_CORE_LOG_DEBUG(...) \
138 SPDLOG_LOGGER_DEBUG(GpgFrontend::GetCoreLogger(), __VA_ARGS__)
139 #define GF_CORE_LOG_INFO(...) \
140 SPDLOG_LOGGER_INFO(GpgFrontend::GetCoreLogger(), __VA_ARGS__)
141 #define GF_CORE_LOG_WARN(...) \
142 SPDLOG_LOGGER_WARN(GpgFrontend::GetCoreLogger(), __VA_ARGS__)
143 #define GF_CORE_LOG_ERROR(...) \
144 SPDLOG_LOGGER_ERROR(GpgFrontend::GetCoreLogger(), __VA_ARGS__)
146 #define GF_LOG_TRACE(ID, ...) \
147 SPDLOG_LOGGER_TRACE(GpgFrontend::GetLogger(ID), __VA_ARGS__)
148 #define GF_LOG_DEBUG(ID, ...) \
149 SPDLOG_LOGGER_DEBUG(GpgFrontend::GetLogger(ID), __VA_ARGS__)
150 #define GF_LOG_INFO(ID, ...) \
151 SPDLOG_LOGGER_INFO(GpgFrontend::GetLogger(ID), __VA_ARGS__)
152 #define GF_LOG_WARN(ID, ...) \
153 SPDLOG_LOGGER_WARN(GpgFrontend::GetLogger(ID), __VA_ARGS__)
154 #define GF_LOG_ERROR(ID, ...) \
155 SPDLOG_LOGGER_ERROR(GpgFrontend::GetLogger(ID), __VA_ARGS__)
void RegisterAsyncLogger(const QString &id, spdlog::level::level_enum level)
Definition: LogUtils.cpp:51
auto GetLogger(const QString &id) -> std::shared_ptr< spdlog::logger >
Definition: LogUtils.cpp:43
auto GetDefaultLogger() -> std::shared_ptr< spdlog::logger >
Definition: LogUtils.cpp:35
void SetDefaultLogLevel(spdlog::level::level_enum level)
Set the Default Log Level object.
Definition: LogUtils.cpp:47
auto GetCoreLogger() -> std::shared_ptr< spdlog::logger >
Definition: LogUtils.cpp:39
void RegisterSyncLogger(const QString &id, spdlog::level::level_enum level)
Definition: LogUtils.cpp:55