| 164 | } |
| 165 | |
| 166 | void CrashLog::PrintCrashLog() const |
| 167 | { |
| 168 | fmt::print(" OpenTTD version:\n"); |
| 169 | fmt::print(" Version: {}\n", this->survey["info"]["openttd"]["version"]["revision"].get<std::string>()); |
| 170 | fmt::print(" Hash: {}\n", this->survey["info"]["openttd"]["version"]["hash"].get<std::string>()); |
| 171 | fmt::print(" NewGRF ver: {}\n", this->survey["info"]["openttd"]["version"]["newgrf"].get<std::string>()); |
| 172 | fmt::print(" Content ver: {}\n", this->survey["info"]["openttd"]["version"]["content"].get<std::string>()); |
| 173 | fmt::print("\n"); |
| 174 | |
| 175 | fmt::print(" Crash:\n"); |
| 176 | fmt::print(" Reason: {}\n", this->survey["crash"]["reason"].get<std::string>()); |
| 177 | fmt::print("\n"); |
| 178 | |
| 179 | fmt::print(" Stacktrace:\n"); |
| 180 | for (const auto &line : this->survey["stacktrace"]) { |
| 181 | fmt::print(" {}\n", line.get<std::string>()); |
| 182 | } |
| 183 | fmt::print("\n"); |
| 184 | } |
| 185 | |
| 186 | /** |
| 187 | * Write the crash log to a file. |