summaryrefslogtreecommitdiffstats
path: root/src/Logger.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Logger.cpp79
1 files changed, 55 insertions, 24 deletions
diff --git a/src/Logger.cpp b/src/Logger.cpp
index 60f5a88d2..f0080e73c 100644
--- a/src/Logger.cpp
+++ b/src/Logger.cpp
@@ -63,11 +63,18 @@ void cLogger::LogSimple(AString a_Message, eLogLevel a_LogLevel)
-void cLogger::Log(const char * a_Format, eLogLevel a_LogLevel, va_list a_ArgList)
+void cLogger::LogPrintf(const char * a_Format, eLogLevel a_LogLevel, fmt::ArgList a_ArgList)
{
- AString Message;
- AppendVPrintf(Message, a_Format, a_ArgList);
- LogSimple(Message, a_LogLevel);
+ LogSimple(Printf(a_Format, a_ArgList), a_LogLevel);
+}
+
+
+
+
+
+void cLogger::LogFormat(const char * a_Format, eLogLevel a_LogLevel, fmt::ArgList a_ArgList)
+{
+ LogSimple(fmt::format(a_Format, a_ArgList), a_LogLevel);
}
@@ -110,48 +117,72 @@ void cLogger::DetachListener(cListener * a_Listener)
////////////////////////////////////////////////////////////////////////////////
// Global functions
-void LOG(const char * a_Format, ...)
+void FLOG(const char * a_Format, fmt::ArgList a_ArgList)
+{
+ cLogger::GetInstance().LogFormat(a_Format, cLogger::llRegular, a_ArgList);
+}
+
+
+
+
+
+void FLOGINFO(const char * a_Format, fmt::ArgList a_ArgList)
+{
+ cLogger::GetInstance().LogFormat( a_Format, cLogger::llInfo, a_ArgList);
+}
+
+
+
+
+
+void FLOGWARNING(const char * a_Format, fmt::ArgList a_ArgList)
+{
+ cLogger::GetInstance().LogFormat( a_Format, cLogger::llWarning, a_ArgList);
+}
+
+
+
+
+
+void FLOGERROR(const char * a_Format, fmt::ArgList a_ArgList)
+{
+ cLogger::GetInstance().LogFormat( a_Format, cLogger::llError, a_ArgList);
+}
+
+
+
+
+
+void LOG(const char * a_Format, fmt::ArgList a_ArgList)
{
- va_list argList;
- va_start(argList, a_Format);
- cLogger::GetInstance().Log(a_Format, cLogger::llRegular, argList);
- va_end(argList);
+ cLogger::GetInstance().LogPrintf(a_Format, cLogger::llRegular, a_ArgList);
}
-void LOGINFO(const char * a_Format, ...)
+void LOGINFO(const char * a_Format, fmt::ArgList a_ArgList)
{
- va_list argList;
- va_start(argList, a_Format);
- cLogger::GetInstance().Log( a_Format, cLogger::llInfo, argList);
- va_end(argList);
+ cLogger::GetInstance().LogPrintf( a_Format, cLogger::llInfo, a_ArgList);
}
-void LOGWARNING(const char * a_Format, ...)
+void LOGWARNING(const char * a_Format, fmt::ArgList a_ArgList)
{
- va_list argList;
- va_start(argList, a_Format);
- cLogger::GetInstance().Log( a_Format, cLogger::llWarning, argList);
- va_end(argList);
+ cLogger::GetInstance().LogPrintf( a_Format, cLogger::llWarning, a_ArgList);
}
-void LOGERROR(const char * a_Format, ...)
+void LOGERROR(const char * a_Format, fmt::ArgList a_ArgList)
{
- va_list argList;
- va_start(argList, a_Format);
- cLogger::GetInstance().Log( a_Format, cLogger::llError, argList);
- va_end(argList);
+ cLogger::GetInstance().LogPrintf( a_Format, cLogger::llError, a_ArgList);
}