mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-04-26 20:31:41 +00:00
logger: stub out utility logs for Release in the macros
This commit is contained in:
parent
0813be2acf
commit
e7d7431b58
2 changed files with 24 additions and 9 deletions
|
|
@ -8,27 +8,47 @@
|
||||||
// Function-specific logging.
|
// Function-specific logging.
|
||||||
|
|
||||||
#define LOG(str) LOG_IMPL(None, __func__, str)
|
#define LOG(str) LOG_IMPL(None, __func__, str)
|
||||||
#define LOG_UTILITY(str) LOG_IMPL(Utility, __func__, str)
|
|
||||||
#define LOG_WARNING(str) LOG_IMPL(Warning, __func__, str)
|
#define LOG_WARNING(str) LOG_IMPL(Warning, __func__, str)
|
||||||
#define LOG_ERROR(str) LOG_IMPL(Error, __func__, str)
|
#define LOG_ERROR(str) LOG_IMPL(Error, __func__, str)
|
||||||
|
|
||||||
|
#if _DEBUG
|
||||||
|
#define LOG_UTILITY(str) LOG_IMPL(Utility, __func__, str)
|
||||||
|
#else
|
||||||
|
#define LOG_UTILITY(str)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define LOGF(str, ...) LOGF_IMPL(None, __func__, str, __VA_ARGS__)
|
#define LOGF(str, ...) LOGF_IMPL(None, __func__, str, __VA_ARGS__)
|
||||||
#define LOGF_UTILITY(str, ...) LOGF_IMPL(Utility, __func__, str, __VA_ARGS__)
|
|
||||||
#define LOGF_WARNING(str, ...) LOGF_IMPL(Warning, __func__, str, __VA_ARGS__)
|
#define LOGF_WARNING(str, ...) LOGF_IMPL(Warning, __func__, str, __VA_ARGS__)
|
||||||
#define LOGF_ERROR(str, ...) LOGF_IMPL(Error, __func__, str, __VA_ARGS__)
|
#define LOGF_ERROR(str, ...) LOGF_IMPL(Error, __func__, str, __VA_ARGS__)
|
||||||
|
|
||||||
|
#if _DEBUG
|
||||||
|
#define LOGF_UTILITY(str, ...) LOGF_IMPL(Utility, __func__, str, __VA_ARGS__)
|
||||||
|
#else
|
||||||
|
#define LOGF_UTILITY(str, ...)
|
||||||
|
#endif
|
||||||
|
|
||||||
// Non-function-specific logging.
|
// Non-function-specific logging.
|
||||||
|
|
||||||
#define LOGN(str) LOG_IMPL(None, "*", str)
|
#define LOGN(str) LOG_IMPL(None, "*", str)
|
||||||
#define LOGN_UTILITY(str) LOG_IMPL(Utility, "*", str)
|
|
||||||
#define LOGN_WARNING(str) LOG_IMPL(Warning, "*", str)
|
#define LOGN_WARNING(str) LOG_IMPL(Warning, "*", str)
|
||||||
#define LOGN_ERROR(str) LOG_IMPL(Error, "*", str)
|
#define LOGN_ERROR(str) LOG_IMPL(Error, "*", str)
|
||||||
|
|
||||||
|
#if _DEBUG
|
||||||
|
#define LOGN_UTILITY(str) LOG_IMPL(Utility, "*", str)
|
||||||
|
#else
|
||||||
|
#define LOGN_UTILITY(str)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define LOGFN(str, ...) LOGF_IMPL(None, "*", str, __VA_ARGS__)
|
#define LOGFN(str, ...) LOGF_IMPL(None, "*", str, __VA_ARGS__)
|
||||||
#define LOGFN_UTILITY(str, ...) LOGF_IMPL(Utility, "*", str, __VA_ARGS__)
|
|
||||||
#define LOGFN_WARNING(str, ...) LOGF_IMPL(Warning, "*", str, __VA_ARGS__)
|
#define LOGFN_WARNING(str, ...) LOGF_IMPL(Warning, "*", str, __VA_ARGS__)
|
||||||
#define LOGFN_ERROR(str, ...) LOGF_IMPL(Error, "*", str, __VA_ARGS__)
|
#define LOGFN_ERROR(str, ...) LOGF_IMPL(Error, "*", str, __VA_ARGS__)
|
||||||
|
|
||||||
|
#if _DEBUG
|
||||||
|
#define LOGFN_UTILITY(str, ...) LOGF_IMPL(Utility, "*", str, __VA_ARGS__)
|
||||||
|
#else
|
||||||
|
#define LOGFN_UTILITY(str, ...)
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace os::logger
|
namespace os::logger
|
||||||
{
|
{
|
||||||
void Log(const std::string& str, detail::ELogType type = detail::ELogType::None, const char* func = nullptr);
|
void Log(const std::string& str, detail::ELogType type = detail::ELogType::None, const char* func = nullptr);
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,6 @@ HANDLE g_hStandardOutput = nullptr;
|
||||||
|
|
||||||
void os::logger::detail::Log(const std::string& str, detail::ELogType type, const char* func)
|
void os::logger::detail::Log(const std::string& str, detail::ELogType type, const char* func)
|
||||||
{
|
{
|
||||||
#if !_DEBUG
|
|
||||||
if (type == ELogType::Utility)
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!g_hStandardOutput)
|
if (!g_hStandardOutput)
|
||||||
g_hStandardOutput = GetStdHandle(STD_OUTPUT_HANDLE);
|
g_hStandardOutput = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue