summaryrefslogtreecommitdiffstats
path: root/src/Logger.cpp
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2018-01-03 18:41:16 +0100
committerGitHub <noreply@github.com>2018-01-03 18:41:16 +0100
commit757231cc6e777b8f4717d1467ef7efa01c7fde15 (patch)
tree6d1021761ad1c492700fe17560cb79520e508d60 /src/Logger.cpp
parentConcrete mixing (#4096) (diff)
downloadcuberite-757231cc6e777b8f4717d1467ef7efa01c7fde15.tar
cuberite-757231cc6e777b8f4717d1467ef7efa01c7fde15.tar.gz
cuberite-757231cc6e777b8f4717d1467ef7efa01c7fde15.tar.bz2
cuberite-757231cc6e777b8f4717d1467ef7efa01c7fde15.tar.lz
cuberite-757231cc6e777b8f4717d1467ef7efa01c7fde15.tar.xz
cuberite-757231cc6e777b8f4717d1467ef7efa01c7fde15.tar.zst
cuberite-757231cc6e777b8f4717d1467ef7efa01c7fde15.zip
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);
}