diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp index cfe7fe305..9761649ed 100644 --- a/apps/openmw/main.cpp +++ b/apps/openmw/main.cpp @@ -38,6 +38,7 @@ extern int is_debugger_attached(void); #endif #include +#include /** * Workaround for problems with whitespaces in paths in older versions of Boost library */ @@ -337,6 +338,7 @@ int main(int argc, char**argv) std::cout.rdbuf (&coutsb); std::cerr.rdbuf (&cerrsb); #endif + LOG_INIT(Log::LOG_INFO); #if USE_CRASH_CATCHER @@ -380,6 +382,8 @@ int main(int argc, char**argv) std::cout.rdbuf(cout_rdbuf); std::cerr.rdbuf(cerr_rdbuf); + LOG_QUIT(); + return ret; } diff --git a/apps/openmw/mwmp/Main.cpp b/apps/openmw/mwmp/Main.cpp index a9c7cc601..ad2a5f684 100644 --- a/apps/openmw/mwmp/Main.cpp +++ b/apps/openmw/mwmp/Main.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include "DedicatedPlayer.hpp" #include "LocalPlayer.hpp" @@ -57,7 +58,7 @@ std::string loadSettings (Settings::Manager & settings) Main::Main() { - std::cout << "Main::Main" << std::endl; + LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "%s", "TES3MP started"); mNetworking = new Networking(); mLocalPlayer = new LocalPlayer(); mGUIController = new GUIController(); @@ -69,7 +70,7 @@ Main::Main() Main::~Main() { - std::cout << "Main::~Main" << std::endl; + LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "%s", "TES3MP stopped"); delete mNetworking; delete mLocalPlayer; delete mGUIController; @@ -90,6 +91,8 @@ void Main::Create() mgr.mChangedSettings.clear(); loadSettings(mgr); + int logLevel = mgr.getInt("loglevel", "General"); + Log::SetLevel(logLevel); pMain->server = mgr.getString("server", "General"); pMain->port = (unsigned short)mgr.getInt("port", "General"); diff --git a/files/tes3mp/tes3mp-client-default.cfg b/files/tes3mp/tes3mp-client-default.cfg index 24f461e02..a49b18123 100644 --- a/files/tes3mp/tes3mp-client-default.cfg +++ b/files/tes3mp/tes3mp-client-default.cfg @@ -1,4 +1,6 @@ [General] +#0 - Verbose (spam), 1 - Info, 2 - Warnings, 3 - Errors, 4 - Only fatal errors +loglevel = 0 #master = master.tes3mp.com:8088 server = mp.tes3mp.com port = 25565