summaryrefslogtreecommitdiffstats
path: root/Tools/ProtoProxy/Connection.cpp
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2020-05-05 23:52:14 +0200
committerGitHub <noreply@github.com>2020-05-05 23:52:14 +0200
commit57952505e522be868a5a8270d8670163b55ebade (patch)
treecf3c5544612b8a51075b498fa14dba8fe758d656 /Tools/ProtoProxy/Connection.cpp
parentRequire semi-colon at end of function-like macros (#4719) (diff)
downloadcuberite-57952505e522be868a5a8270d8670163b55ebade.tar
cuberite-57952505e522be868a5a8270d8670163b55ebade.tar.gz
cuberite-57952505e522be868a5a8270d8670163b55ebade.tar.bz2
cuberite-57952505e522be868a5a8270d8670163b55ebade.tar.lz
cuberite-57952505e522be868a5a8270d8670163b55ebade.tar.xz
cuberite-57952505e522be868a5a8270d8670163b55ebade.tar.zst
cuberite-57952505e522be868a5a8270d8670163b55ebade.zip
Diffstat (limited to '')
-rw-r--r--Tools/ProtoProxy/Connection.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/Tools/ProtoProxy/Connection.cpp b/Tools/ProtoProxy/Connection.cpp
index 51b94f2a2..3049826b6 100644
--- a/Tools/ProtoProxy/Connection.cpp
+++ b/Tools/ProtoProxy/Connection.cpp
@@ -284,16 +284,13 @@ void cConnection::Run(void)
-void cConnection::Log(const char * a_Format, fmt::ArgList a_Args)
+void cConnection::vLog(const char * a_Format, fmt::printf_args a_Args)
{
- fmt::MemoryWriter FullMsg;
- fmt::printf(FullMsg, "[%5.3f] ", GetRelativeTime());
- fmt::printf(FullMsg, a_Format, a_Args);
- fmt::printf(FullMsg, "\n");
-
// Log to file:
cCSLock Lock(m_CSLog);
- fputs(FullMsg.c_str(), m_LogFile);
+ fmt::fprintf(m_LogFile, "[%5.3f] ", GetRelativeTime());
+ fmt::vfprintf(m_LogFile, a_Format, a_Args);
+ fmt::fprintf(m_LogFile, "\n");
#ifdef _DEBUG
fflush(m_LogFile);
#endif // _DEBUG
@@ -306,17 +303,16 @@ void cConnection::Log(const char * a_Format, fmt::ArgList a_Args)
-void cConnection::DataLog(const void * a_Data, size_t a_Size, const char * a_Format, fmt::ArgList a_Args)
+void cConnection::vDataLog(const void * a_Data, size_t a_Size, const char * a_Format, fmt::printf_args a_Args)
{
- fmt::MemoryWriter FullMsg;
- fmt::printf(FullMsg, "[%5.3f] ", GetRelativeTime());
- fmt::printf(FullMsg, a_Format, a_Args);
AString Hex;
- fmt::printf(FullMsg, "\n%s\n", CreateHexDump(Hex, a_Data, a_Size, 16));
+ CreateHexDump(Hex, a_Data, a_Size, 16);
// Log to file:
cCSLock Lock(m_CSLog);
- fputs(FullMsg.c_str(), m_LogFile);
+ fmt::fprintf(m_LogFile, "[%5.3f] ", GetRelativeTime());
+ fmt::vfprintf(m_LogFile, a_Format, a_Args);
+ fmt::fprintf(m_LogFile, "\n%s\n", Hex);
/*
// Log to screen: