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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user