OpenTTD Source  20241121-master-g67a0fccfad
crashlog.cpp File Reference

Implementation of generic function to be called to log a crash. More...

#include "stdafx.h"
#include "crashlog.h"
#include "survey.h"
#include "gamelog.h"
#include "map_func.h"
#include "music/music_driver.hpp"
#include "sound/sound_driver.hpp"
#include "video/video_driver.hpp"
#include "saveload/saveload.h"
#include "screenshot.h"
#include "network/network_survey.h"
#include "news_gui.h"
#include "fileio_func.h"
#include "fileio_type.h"
#include "company_func.h"
#include "3rdparty/fmt/chrono.h"
#include "3rdparty/fmt/std.h"
#include "core/format.hpp"
#include "safeguards.h"

Go to the source code of this file.

Functions

static void SurveyGamelog (nlohmann::json &json)
 Writes the gamelog data to the buffer. More...
 
static void SurveyRecentNews (nlohmann::json &json)
 Writes up to 32 recent news messages to the buffer, with the most recent first. More...
 

Variables

constexpr uint8_t CRASHLOG_SURVEY_VERSION = 1
 The version of the schema of the JSON information.
 

Detailed Description

Implementation of generic function to be called to log a crash.

Definition in file crashlog.cpp.

Function Documentation

◆ SurveyGamelog()

static void SurveyGamelog ( nlohmann::json &  json)
static

Writes the gamelog data to the buffer.

Parameters
output_iteratorIterator to write the output to.

Definition at line 41 of file crashlog.cpp.

References _gamelog, and Gamelog::Print().

◆ SurveyRecentNews()

static void SurveyRecentNews ( nlohmann::json &  json)
static

Writes up to 32 recent news messages to the buffer, with the most recent first.

Parameters
output_iteratorIterator to write the output to.

Definition at line 54 of file crashlog.cpp.

References TimerGameCalendar::ConvertDateToYMD(), and GetNews().