GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
LogUtils.h
1 
29 #pragma once
30 
31 namespace GpgFrontend {
32 
38 auto GPGFRONTEND_CORE_EXPORT GetDefaultLogger()
39  -> std::shared_ptr<spdlog::logger>;
40 
46 auto GPGFRONTEND_CORE_EXPORT GetCoreLogger() -> std::shared_ptr<spdlog::logger>;
47 
53 auto GPGFRONTEND_CORE_EXPORT GetLogger(const QString &)
54  -> std::shared_ptr<spdlog::logger>;
55 
61 void GPGFRONTEND_CORE_EXPORT SetDefaultLogLevel(spdlog::level::level_enum);
62 
68 void GPGFRONTEND_CORE_EXPORT RegisterAsyncLogger(const QString &,
69  spdlog::level::level_enum);
70 
76 void GPGFRONTEND_CORE_EXPORT RegisterSyncLogger(const QString &,
77  spdlog::level::level_enum);
78 
79 } // namespace GpgFrontend
80 
81 #define GF_DEFAULT_LOG_TRACE(...) \
82  SPDLOG_LOGGER_TRACE(GpgFrontend::GetDefaultLogger(), __VA_ARGS__)
83 #define GF_DEFAULT_LOG_DEBUG(...) \
84  SPDLOG_LOGGER_DEBUG(GpgFrontend::GetDefaultLogger(), __VA_ARGS__)
85 #define GF_DEFAULT_LOG_INFO(...) \
86  SPDLOG_LOGGER_INFO(GpgFrontend::GetDefaultLogger(), __VA_ARGS__)
87 #define GF_DEFAULT_LOG_WARN(...) \
88  SPDLOG_LOGGER_WARN(GpgFrontend::GetDefaultLogger(), __VA_ARGS__)
89 #define GF_DEFAULT_LOG_ERROR(...) \
90  SPDLOG_LOGGER_ERROR(GpgFrontend::GetDefaultLogger(), __VA_ARGS__)
91 
92 #define GF_CORE_LOG_TRACE(...) \
93  SPDLOG_LOGGER_TRACE(GpgFrontend::GetCoreLogger(), __VA_ARGS__)
94 #define GF_CORE_LOG_DEBUG(...) \
95  SPDLOG_LOGGER_DEBUG(GpgFrontend::GetCoreLogger(), __VA_ARGS__)
96 #define GF_CORE_LOG_INFO(...) \
97  SPDLOG_LOGGER_INFO(GpgFrontend::GetCoreLogger(), __VA_ARGS__)
98 #define GF_CORE_LOG_WARN(...) \
99  SPDLOG_LOGGER_WARN(GpgFrontend::GetCoreLogger(), __VA_ARGS__)
100 #define GF_CORE_LOG_ERROR(...) \
101  SPDLOG_LOGGER_ERROR(GpgFrontend::GetCoreLogger(), __VA_ARGS__)
102 
103 #define GF_LOG_TRACE(ID, ...) \
104  SPDLOG_LOGGER_TRACE(GpgFrontend::GetLogger(ID), __VA_ARGS__)
105 #define GF_LOG_DEBUG(ID, ...) \
106  SPDLOG_LOGGER_DEBUG(GpgFrontend::GetLogger(ID), __VA_ARGS__)
107 #define GF_LOG_INFO(ID, ...) \
108  SPDLOG_LOGGER_INFO(GpgFrontend::GetLogger(ID), __VA_ARGS__)
109 #define GF_LOG_WARN(ID, ...) \
110  SPDLOG_LOGGER_WARN(GpgFrontend::GetLogger(ID), __VA_ARGS__)
111 #define GF_LOG_ERROR(ID, ...) \
112  SPDLOG_LOGGER_ERROR(GpgFrontend::GetLogger(ID), __VA_ARGS__)
Definition: app.cpp:39
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