summaryrefslogtreecommitdiffstats
path: root/Tools/MCADefrag
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-08-22 15:18:39 +0200
committerMattes D <github@xoft.cz>2014-08-22 15:18:39 +0200
commite034b64a5b4aab6f285ba732923cea70dca44d2d (patch)
tree9705effad70cbd41078d7893feda0a0236515581 /Tools/MCADefrag
parentcMojangAPI updates cRankManager's playernames. (diff)
parentFixed a warning in FastRandom. (diff)
downloadcuberite-e034b64a5b4aab6f285ba732923cea70dca44d2d.tar
cuberite-e034b64a5b4aab6f285ba732923cea70dca44d2d.tar.gz
cuberite-e034b64a5b4aab6f285ba732923cea70dca44d2d.tar.bz2
cuberite-e034b64a5b4aab6f285ba732923cea70dca44d2d.tar.lz
cuberite-e034b64a5b4aab6f285ba732923cea70dca44d2d.tar.xz
cuberite-e034b64a5b4aab6f285ba732923cea70dca44d2d.tar.zst
cuberite-e034b64a5b4aab6f285ba732923cea70dca44d2d.zip
Diffstat (limited to '')
-rw-r--r--Tools/MCADefrag/CMakeLists.txt6
-rw-r--r--Tools/MCADefrag/MCADefrag.cpp16
2 files changed, 16 insertions, 6 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/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;
}