|
@@ -90,29 +90,24 @@ void CrashLog::LogCompiler(std::back_ins
|
|
|
"GCC {}.{}.{}", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__
|
|
|
#else
|
|
|
"<unknown>"
|
|
|
#endif
|
|
|
);
|
|
|
#if defined(__VERSION__)
|
|
|
fmt::format_to(output_iterator, " \"" __VERSION__ "\"\n\n");
|
|
|
#else
|
|
|
fmt::format_to(output_iterator, "\n\n");
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
/* virtual */ void CrashLog::LogRegisters(std::back_insert_iterator<std::string> &output_iterator) const
|
|
|
{
|
|
|
/* Stub implementation; not all OSes support this. */
|
|
|
}
|
|
|
|
|
|
/* virtual */ void CrashLog::LogModules(std::back_insert_iterator<std::string> &output_iterator) const
|
|
|
{
|
|
|
/* Stub implementation; not all OSes support this. */
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Writes OpenTTD's version to the buffer.
|
|
|
* @param output_iterator Iterator to write the output to.
|
|
|
*/
|
|
|
void CrashLog::LogOpenTTDVersion(std::back_insert_iterator<std::string> &output_iterator) const
|
|
|
{
|
|
|
fmt::format_to(output_iterator,
|
|
@@ -334,25 +329,24 @@ std::string CrashLog::CreateFileName(con
|
|
|
*/
|
|
|
void CrashLog::FillCrashLog(std::back_insert_iterator<std::string> &output_iterator) const
|
|
|
{
|
|
|
fmt::format_to(output_iterator, "*** OpenTTD Crash Report ***\n\n");
|
|
|
fmt::format_to(output_iterator, "Crash at: {:%Y-%m-%d %H:%M:%S} (UTC)\n", fmt::gmtime(time(nullptr)));
|
|
|
|
|
|
TimerGameCalendar::YearMonthDay ymd;
|
|
|
TimerGameCalendar::ConvertDateToYMD(TimerGameCalendar::date, &ymd);
|
|
|
fmt::format_to(output_iterator, "In game date: {}-{:02}-{:02} ({})\n\n", ymd.year, ymd.month + 1, ymd.day, TimerGameCalendar::date_fract);
|
|
|
|
|
|
this->LogError(output_iterator, CrashLog::message);
|
|
|
this->LogOpenTTDVersion(output_iterator);
|
|
|
this->LogRegisters(output_iterator);
|
|
|
this->LogStacktrace(output_iterator);
|
|
|
this->LogOSVersion(output_iterator);
|
|
|
this->LogCompiler(output_iterator);
|
|
|
this->LogConfiguration(output_iterator);
|
|
|
this->LogLibraries(output_iterator);
|
|
|
this->LogModules(output_iterator);
|
|
|
this->LogGamelog(output_iterator);
|
|
|
this->LogRecentNews(output_iterator);
|
|
|
|
|
|
fmt::format_to(output_iterator, "*** End of OpenTTD Crash Report ***\n");
|
|
|
}
|
|
|
|