From df854f72a65fde8dfc87425af3fa8327ebe05291 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Mon, 31 Aug 2015 23:51:50 -0400 Subject: [PATCH] only print 'Loaded autorun.lua' to screen (not to console/stdout.txt) All the other debug output was already removed in earlier commits --- src/gui/game/GameController.cpp | 2 +- src/gui/game/GameModel.cpp | 5 +++-- src/gui/game/GameModel.h | 2 +- src/lua/CommandInterface.cpp | 2 +- src/lua/LuaScriptInterface.cpp | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/gui/game/GameController.cpp b/src/gui/game/GameController.cpp index fc3313a24..8f35fc494 100644 --- a/src/gui/game/GameController.cpp +++ b/src/gui/game/GameController.cpp @@ -1464,7 +1464,7 @@ void GameController::ParticleDebug(int mode, int x, int y) else logmessage << "Updated particles #" << debug_currentParticle << " through #" << i; } - gameModel->Log(logmessage.str()); + gameModel->Log(logmessage.str(), false); sim->UpdateParticles(debug_currentParticle, i); if (i < NPART-1) diff --git a/src/gui/game/GameModel.cpp b/src/gui/game/GameModel.cpp index a65f8edcc..ef91b5fd9 100644 --- a/src/gui/game/GameModel.cpp +++ b/src/gui/game/GameModel.cpp @@ -924,13 +924,14 @@ GameSave * GameModel::GetPlaceSave() return placeSave; } -void GameModel::Log(string message) +void GameModel::Log(string message, bool printToFile) { consoleLog.push_front(message); if(consoleLog.size()>100) consoleLog.pop_back(); notifyLogChanged(message); - std::cout << message << std::endl; + if (printToFile) + std::cout << message << std::endl; } deque GameModel::GetLog() diff --git a/src/gui/game/GameModel.h b/src/gui/game/GameModel.h index 6b844ec3c..38d781369 100644 --- a/src/gui/game/GameModel.h +++ b/src/gui/game/GameModel.h @@ -187,7 +187,7 @@ public: ui::Point GetZoomWindowPosition(); void SetClipboard(GameSave * save); void SetPlaceSave(GameSave * save); - void Log(string message); + void Log(string message, bool printToFile); deque GetLog(); GameSave * GetClipboard(); GameSave * GetPlaceSave(); diff --git a/src/lua/CommandInterface.cpp b/src/lua/CommandInterface.cpp index 55b1bb718..d6aea0615 100644 --- a/src/lua/CommandInterface.cpp +++ b/src/lua/CommandInterface.cpp @@ -31,7 +31,7 @@ std::string CommandInterface::FormatCommand(std::string command) void CommandInterface::Log(LogType type, std::string message) { - m->Log(message); + m->Log(message, type == LogError || type == LogNotice); } int CommandInterface::GetPropertyOffset(std::string key, FormatType & format) diff --git a/src/lua/LuaScriptInterface.cpp b/src/lua/LuaScriptInterface.cpp index 3998121ef..ea8c97bee 100644 --- a/src/lua/LuaScriptInterface.cpp +++ b/src/lua/LuaScriptInterface.cpp @@ -358,7 +358,7 @@ void LuaScriptInterface::Init() if(luaL_loadfile(l, "autorun.lua") || lua_pcall(l, 0, 0, 0)) luacon_ci->Log(CommandInterface::LogError, luacon_geterror()); else - luacon_ci->Log(CommandInterface::LogNotice, "Loaded autorun.lua"); + luacon_ci->Log(CommandInterface::LogWarning, "Loaded autorun.lua"); } }