summaryrefslogtreecommitdiffstats
path: root/Tools/MCADefrag/MCADefrag.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-08-15 07:20:37 +0200
committerMattes D <github@xoft.cz>2014-08-15 07:20:37 +0200
commite553d58eaf4dfdc56ebb1e3155f8b4dd2a33d7f1 (patch)
tree8a4f77b7471841910afbfdf7ebabbba68886c9b1 /Tools/MCADefrag/MCADefrag.cpp
parentCheckBasicStyle checks the src folder as well. (diff)
parentRemoved an unneeded cast. (diff)
downloadcuberite-e553d58eaf4dfdc56ebb1e3155f8b4dd2a33d7f1.tar
cuberite-e553d58eaf4dfdc56ebb1e3155f8b4dd2a33d7f1.tar.gz
cuberite-e553d58eaf4dfdc56ebb1e3155f8b4dd2a33d7f1.tar.bz2
cuberite-e553d58eaf4dfdc56ebb1e3155f8b4dd2a33d7f1.tar.lz
cuberite-e553d58eaf4dfdc56ebb1e3155f8b4dd2a33d7f1.tar.xz
cuberite-e553d58eaf4dfdc56ebb1e3155f8b4dd2a33d7f1.tar.zst
cuberite-e553d58eaf4dfdc56ebb1e3155f8b4dd2a33d7f1.zip
Diffstat (limited to 'Tools/MCADefrag/MCADefrag.cpp')
-rw-r--r--Tools/MCADefrag/MCADefrag.cpp16
1 files changed, 14 insertions, 2 deletions
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;
}