Merge branch 'crashlog_improvements' into jgrpp

# Conflicts:
#	src/misc.cpp
#	src/openttd.cpp
This commit is contained in:
Jonathan G Rennison
2017-02-21 21:50:08 +00:00
9 changed files with 133 additions and 4 deletions

View File

@@ -29,6 +29,7 @@
#include "language.h"
#include "fontcache.h"
#include "scope_info.h"
#include "command_func.h"
#include "thread/thread.h"
#include "ai/ai_info.hpp"
@@ -328,6 +329,19 @@ char *CrashLog::LogGamelog(char *buffer, const char *last) const
return CrashLog::gamelog_buffer + seprintf(CrashLog::gamelog_buffer, last, "\n");
}
/**
* Writes the command log data to the buffer.
* @param buffer The begin where to write at.
* @param last The last position in the buffer to write to.
* @return the position of the \c '\0' character after the buffer.
*/
char *CrashLog::LogCommandLog(char *buffer, const char *last) const
{
buffer = DumpCommandLog(buffer, last);
buffer += seprintf(buffer, last, "\n");
return buffer;
}
/**
* Fill the crash log buffer with all data of a crash log.
* @param buffer The begin where to write at.
@@ -362,6 +376,7 @@ char *CrashLog::FillCrashLog(char *buffer, const char *last) const
buffer = this->LogLibraries(buffer, last);
buffer = this->LogModules(buffer, last);
buffer = this->LogGamelog(buffer, last);
buffer = this->LogCommandLog(buffer, last);
buffer += seprintf(buffer, last, "*** End of OpenTTD Crash Report ***\n");
return buffer;
@@ -454,7 +469,7 @@ bool CrashLog::MakeCrashLog() const
crashlogged = true;
char filename[MAX_PATH];
char buffer[65536];
char buffer[65536 * 2];
bool ret = true;
printf("Crash encountered, generating crash log...\n");