Permalink
Browse files

only print 'Loaded autorun.lua' to screen (not to console/stdout.txt)

All the other debug output was already removed in earlier commits
  • Loading branch information...
jacob1 committed Sep 1, 2015
1 parent 9048a3c commit df854f72a65fde8dfc87425af3fa8327ebe05291
@@ -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)
@@ -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<string> GameModel::GetLog()
@@ -187,7 +187,7 @@ class GameModel
ui::Point GetZoomWindowPosition();
void SetClipboard(GameSave * save);
void SetPlaceSave(GameSave * save);
void Log(string message);
void Log(string message, bool printToFile);
deque<string> GetLog();
GameSave * GetClipboard();
GameSave * GetPlaceSave();
@@ -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)
@@ -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");
}
}

0 comments on commit df854f7

Please sign in to comment.