summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorSamuel Barney <samjbarney@gmail.com>2014-08-20 16:42:58 +0200
committerSamuel Barney <samjbarney@gmail.com>2014-08-20 16:42:58 +0200
commit54cb27f8197f6e8c441644ea0182feda6ae78a09 (patch)
tree33a63ee8db20c142d2cccd4b8ace3d4ff65fa88e /Tools
parentAdded new component files. Updated the CMakeLists files (diff)
parentMerge pull request #1335 from mc-server/CodeFixes (diff)
downloadcuberite-54cb27f8197f6e8c441644ea0182feda6ae78a09.tar
cuberite-54cb27f8197f6e8c441644ea0182feda6ae78a09.tar.gz
cuberite-54cb27f8197f6e8c441644ea0182feda6ae78a09.tar.bz2
cuberite-54cb27f8197f6e8c441644ea0182feda6ae78a09.tar.lz
cuberite-54cb27f8197f6e8c441644ea0182feda6ae78a09.tar.xz
cuberite-54cb27f8197f6e8c441644ea0182feda6ae78a09.tar.zst
cuberite-54cb27f8197f6e8c441644ea0182feda6ae78a09.zip
Diffstat (limited to 'Tools')
-rw-r--r--Tools/MCADefrag/CMakeLists.txt6
-rw-r--r--Tools/MCADefrag/Globals.h2
-rw-r--r--Tools/MCADefrag/MCADefrag.cpp16
-rw-r--r--Tools/ProtoProxy/CMakeLists.txt6
4 files changed, 19 insertions, 11 deletions
diff --git a/Tools/MCADefrag/CMakeLists.txt b/Tools/MCADefrag/CMakeLists.txt
index 2a021049f..42b42018b 100644
--- a/Tools/MCADefrag/CMakeLists.txt
+++ b/Tools/MCADefrag/CMakeLists.txt
@@ -39,14 +39,12 @@ set_exe_flags()
set(SHARED_SRC
../../src/StringCompression.cpp
../../src/StringUtils.cpp
- ../../src/Log.cpp
- ../../src/MCLogger.cpp
+ ../../src/LoggerListeners.cpp
+ ../../src/Logger.cpp
)
set(SHARED_HDR
../../src/ByteBuffer.h
../../src/StringUtils.h
- ../../src/Log.h
- ../../src/MCLogger.h
)
flatten_files(SHARED_SRC)
flatten_files(SHARED_HDR)
diff --git a/Tools/MCADefrag/Globals.h b/Tools/MCADefrag/Globals.h
index 6593187e6..288069599 100644
--- a/Tools/MCADefrag/Globals.h
+++ b/Tools/MCADefrag/Globals.h
@@ -240,7 +240,7 @@ template <typename Type> class cItemCallback
public:
/// Called for each item in the internal list; return true to stop the loop, or false to continue enumerating
virtual bool Item(Type * a_Type) = 0;
- virtual ~cItemCallback() {};
+ virtual ~cItemCallback() {}
} ;
diff --git a/Tools/MCADefrag/MCADefrag.cpp b/Tools/MCADefrag/MCADefrag.cpp
index a2de7f957..d5d233fd2 100644
--- a/Tools/MCADefrag/MCADefrag.cpp
+++ b/Tools/MCADefrag/MCADefrag.cpp
@@ -5,7 +5,8 @@
#include "Globals.h"
#include "MCADefrag.h"
-#include "MCLogger.h"
+#include "Logger.h"
+#include "LoggerListeners.h"
#include "zlib/zlib.h"
@@ -21,7 +22,13 @@ static const Byte g_Zeroes[4096] = {0};
int main(int argc, char ** argv)
{
- new cMCLogger(Printf("Defrag_%08x.log", time(NULL)));
+ cLogger::cListener * consoleLogListener = MakeConsoleListener();
+ cLogger::cListener * fileLogListener = new cFileListener();
+ cLogger::GetInstance().AttachListener(consoleLogListener);
+ cLogger::GetInstance().AttachListener(fileLogListener);
+
+ cLogger::InitiateMultithreading();
+
cMCADefrag Defrag;
if (!Defrag.Init(argc, argv))
{
@@ -30,6 +37,11 @@ int main(int argc, char ** argv)
Defrag.Run();
+ cLogger::GetInstance().DetachListener(consoleLogListener);
+ delete consoleLogListener;
+ cLogger::GetInstance().DetachListener(fileLogListener);
+ delete fileLogListener;
+
return 0;
}
diff --git a/Tools/ProtoProxy/CMakeLists.txt b/Tools/ProtoProxy/CMakeLists.txt
index f0796363c..bc3923d90 100644
--- a/Tools/ProtoProxy/CMakeLists.txt
+++ b/Tools/ProtoProxy/CMakeLists.txt
@@ -34,20 +34,18 @@ set_exe_flags()
set(SHARED_SRC
../../src/ByteBuffer.cpp
../../src/StringUtils.cpp
- ../../src/Log.cpp
- ../../src/MCLogger.cpp
../../src/PolarSSL++/AesCfb128Decryptor.cpp
../../src/PolarSSL++/AesCfb128Encryptor.cpp
../../src/PolarSSL++/CryptoKey.cpp
../../src/PolarSSL++/CtrDrbgContext.cpp
../../src/PolarSSL++/EntropyContext.cpp
../../src/PolarSSL++/RsaPrivateKey.cpp
+ ../../src/LoggerListeners.cpp
+ ../../src/Logger.cpp
)
set(SHARED_HDR
../../src/ByteBuffer.h
../../src/StringUtils.h
- ../../src/Log.h
- ../../src/MCLogger.h
../../src/PolarSSL++/AesCfb128Decryptor.h
../../src/PolarSSL++/AesCfb128Encryptor.h
../../src/PolarSSL++/CryptoKey.h