Maintain a circular buffer of recent commands, add to crashlog.

Add console command to dump command log.
Increase max crashlog size.
This commit is contained in:
Jonathan G Rennison
2017-02-21 21:04:28 +00:00
parent 3884ea5da1
commit 349ddd90b7
7 changed files with 129 additions and 1 deletions

View File

@@ -1875,6 +1875,19 @@ DEF_CONSOLE_CMD(ConNewGRFReload)
return true;
}
DEF_CONSOLE_CMD(ConDumpCommandLog)
{
if (argc == 0) {
IConsoleHelp("Dump log of recently executed commands.");
return true;
}
char buffer[32768];
DumpCommandLog(buffer, lastof(buffer));
PrintLineByLine(buffer);
return true;
}
#ifdef _DEBUG
/******************
* debug commands
@@ -2018,6 +2031,7 @@ void IConsoleStdLibRegister()
#ifdef _DEBUG
IConsoleDebugLibRegister();
#endif
IConsoleCmdRegister("dump_command_log", ConDumpCommandLog, nullptr, true);
/* NewGRF development stuff */
IConsoleCmdRegister("reload_newgrfs", ConNewGRFReload, ConHookNewGRFDeveloperTool);