diff options
Diffstat (limited to 'src/LoggerSimple.h')
-rw-r--r-- | src/LoggerSimple.h | 61 |
1 files changed, 37 insertions, 24 deletions
diff --git a/src/LoggerSimple.h b/src/LoggerSimple.h index 83d1c4e86..f8f1ee331 100644 --- a/src/LoggerSimple.h +++ b/src/LoggerSimple.h @@ -2,64 +2,77 @@ // Logging free functions defined in Logger.cpp #pragma once +enum class eLogLevel +{ + Regular, + Info, + Warning, + Error, +}; + +namespace Logger +{ + +extern void LogFormat( + std::string_view a_Format, eLogLevel a_LogLevel, fmt::format_args a_ArgList +); +extern void LogPrintf( + std::string_view a_Format, eLogLevel a_LogLevel, fmt::printf_args a_ArgList +); +extern void LogSimple(std::string_view a_Message, eLogLevel a_LogLevel); + +} // namespace Logger + // python style format specified logging -extern void vFLOG(const char * a_Format, fmt::format_args a_ArgList); template <typename... Args> -void FLOG(const char * a_Format, const Args & ... args) +void FLOG(std::string_view a_Format, const Args & ... args) { - vFLOG(a_Format, fmt::make_format_args(args...)); + Logger::LogFormat(a_Format, eLogLevel::Regular, fmt::make_format_args(args...)); } -extern void vFLOGINFO(const char * a_Format, fmt::format_args a_ArgList); template <typename... Args> -void FLOGINFO(const char * a_Format, const Args & ... args) +void FLOGINFO(std::string_view a_Format, const Args & ... args) { - vFLOGINFO(a_Format, fmt::make_format_args(args...)); + Logger::LogFormat(a_Format, eLogLevel::Info, fmt::make_format_args(args...)); } -extern void vFLOGWARNING(const char * a_Format, fmt::format_args a_ArgList); template <typename... Args> -void FLOGWARNING(const char * a_Format, const Args & ... args) +void FLOGWARNING(std::string_view a_Format, const Args & ... args) { - vFLOGWARNING(a_Format, fmt::make_format_args(args...)); + Logger::LogFormat(a_Format, eLogLevel::Warning, fmt::make_format_args(args...)); } -extern void vFLOGERROR(const char * a_Format, fmt::format_args a_ArgList); template <typename... Args> -void FLOGERROR(const char * a_Format, const Args & ... args) +void FLOGERROR(std::string_view a_Format, const Args & ... args) { - vFLOGERROR(a_Format, fmt::make_format_args(args...)); + Logger::LogFormat(a_Format, eLogLevel::Error, fmt::make_format_args(args...)); } // printf style format specified logging (DEPRECATED) -extern void vLOG(const char * a_Format, fmt::printf_args a_ArgList); template <typename... Args> -void LOG(const char * a_Format, const Args & ... args) +void LOG(std::string_view a_Format, const Args & ... args) { - vLOG(a_Format, fmt::make_printf_args(args...)); + Logger::LogPrintf(a_Format, eLogLevel::Regular, fmt::make_printf_args(args...)); } -extern void vLOGINFO(const char * a_Format, fmt::printf_args a_ArgList); template <typename... Args> -void LOGINFO(const char * a_Format, const Args & ... args) +void LOGINFO(std::string_view a_Format, const Args & ... args) { - vLOGINFO(a_Format, fmt::make_printf_args(args...)); + Logger::LogPrintf(a_Format, eLogLevel::Info, fmt::make_printf_args(args...)); } -extern void vLOGWARNING(const char * a_Format, fmt::printf_args a_ArgList); template <typename... Args> -void LOGWARNING(const char * a_Format, const Args & ... args) +void LOGWARNING(std::string_view a_Format, const Args & ... args) { - vLOGWARNING(a_Format, fmt::make_printf_args(args...)); + Logger::LogPrintf(a_Format, eLogLevel::Warning, fmt::make_printf_args(args...)); } -extern void vLOGERROR(const char * a_Format, fmt::printf_args a_ArgList); template <typename... Args> -void LOGERROR(const char * a_Format, const Args & ... args) +void LOGERROR(std::string_view a_Format, const Args & ... args) { - vLOGERROR(a_Format, fmt::make_printf_args(args...)); + Logger::LogPrintf(a_Format, eLogLevel::Error, fmt::make_printf_args(args...)); } |