FlightGear next
flightgear::ErrorReporter::ErrorReporterPrivate Class Reference

Classes

struct  AggregateReport
 structure representing one or more errors, aggregated together More...
 
struct  ErrorOcurrence
 structure representing a single error which has occurred More...
 

Public Types

using ErrorContext = std::map<std::string, std::string>
 
using OccurrenceVec = std::vector<ErrorOcurrence>
 
using AggregateErrors = std::vector<AggregateReport>
 

Public Member Functions

bool isMainAircraftPath (const std::string &path) const
 hueristic to identify relative paths as origination from the main aircraft as opposed to something else.
 
bool isAnyAircraftPath (const std::string &path) const
 helper to determine if a file looks like it belongs to an aircraft.
 
AggregateErrors::iterator getAggregateForOccurence (const ErrorOcurrence &oc)
 find the appropriate agrgegate for an error, based on its context
 
AggregateErrors::iterator getAggregate (Aggregation ag, const std::string &param={})
 
void collectError (simgear::LoadFailure type, simgear::ErrorCode code, const std::string &details, const sg_location &location)
 
void collectContext (const std::string &key, const std::string &value)
 
void presentErrorToUser (AggregateReport &report)
 
void sendReportToSentry (AggregateReport &report)
 
void writeReportToStream (const AggregateReport &report, std::ostream &os) const
 
void writeContextToStream (const ErrorOcurrence &error, std::ostream &os) const
 
void writeLogToStream (const ErrorOcurrence &error, std::ostream &os) const
 
void writeSignificantPropertiesToStream (std::ostream &os) const
 
bool dismissReportCommand (const SGPropertyNode *args, SGPropertyNode *)
 
bool saveReportCommand (const SGPropertyNode *args, SGPropertyNode *)
 
bool showErrorReportCommand (const SGPropertyNode *args, SGPropertyNode *)
 

Public Attributes

bool _reportsDirty = false
 
std::mutex _lock
 
SGTimeStamp _nextShowTimeout
 
bool _haveDonePostInit = false
 
SGPropertyNode_ptr _enabledNode
 
SGPropertyNode_ptr _displayNode
 
SGPropertyNode_ptr _activeErrorNode
 
SGPropertyNode_ptr _mpReportNode
 
std::unique_ptr< RecentLogCallback > _logCallback
 
bool _logCallbackRegistered = false
 
string _terrasyncPathPrefix
 
string _fgdataPathPrefix
 
string _aircraftDirectoryName
 
AggregateErrors _aggregated
 
int _activeReportIndex = -1
 
string_list _significantProperties
 properties we want to include in reports, for debugging
 

Detailed Description

Definition at line 168 of file ErrorReporter.cxx.

Member Typedef Documentation

◆ AggregateErrors

◆ ErrorContext

using flightgear::ErrorReporter::ErrorReporterPrivate::ErrorContext = std::map<std::string, std::string>

Definition at line 181 of file ErrorReporter.cxx.

◆ OccurrenceVec

Member Function Documentation

◆ collectContext()

void flightgear::ErrorReporter::ErrorReporterPrivate::collectContext ( const std::string & key,
const std::string & value )
inline

Definition at line 300 of file ErrorReporter.cxx.

◆ collectError()

void flightgear::ErrorReporter::ErrorReporterPrivate::collectError ( simgear::LoadFailure type,
simgear::ErrorCode code,
const std::string & details,
const sg_location & location )
inline

Definition at line 258 of file ErrorReporter.cxx.

◆ dismissReportCommand()

bool flightgear::ErrorReporter::ErrorReporterPrivate::dismissReportCommand ( const SGPropertyNode * args,
SGPropertyNode *  )

Definition at line 598 of file ErrorReporter.cxx.

◆ getAggregate()

auto flightgear::ErrorReporter::ErrorReporterPrivate::getAggregate ( Aggregation ag,
const std::string & param = {} )

Definition at line 520 of file ErrorReporter.cxx.

◆ getAggregateForOccurence()

auto flightgear::ErrorReporter::ErrorReporterPrivate::getAggregateForOccurence ( const ErrorOcurrence & oc)

find the appropriate agrgegate for an error, based on its context

Definition at line 392 of file ErrorReporter.cxx.

◆ isAnyAircraftPath()

bool flightgear::ErrorReporter::ErrorReporterPrivate::isAnyAircraftPath ( const std::string & path) const

helper to determine if a file looks like it belongs to an aircraft.

This is used to detect potential cross-aircraft packaging bugs which often lead to 'not found' error reports. So we're looking for paths which look plausibly like any aircraft path, even though isMainAircraftPath didn't match on them.

Definition at line 741 of file ErrorReporter.cxx.

◆ isMainAircraftPath()

bool flightgear::ErrorReporter::ErrorReporterPrivate::isMainAircraftPath ( const std::string & path) const

hueristic to identify relative paths as origination from the main aircraft as opposed to something else.

This is based on containing the aircraft directory name.

Definition at line 728 of file ErrorReporter.cxx.

◆ presentErrorToUser()

void flightgear::ErrorReporter::ErrorReporterPrivate::presentErrorToUser ( AggregateReport & report)
inline

Definition at line 315 of file ErrorReporter.cxx.

◆ saveReportCommand()

bool flightgear::ErrorReporter::ErrorReporterPrivate::saveReportCommand ( const SGPropertyNode * args,
SGPropertyNode *  )

Definition at line 655 of file ErrorReporter.cxx.

◆ sendReportToSentry()

void flightgear::ErrorReporter::ErrorReporterPrivate::sendReportToSentry ( AggregateReport & report)
inline

Definition at line 374 of file ErrorReporter.cxx.

◆ showErrorReportCommand()

bool flightgear::ErrorReporter::ErrorReporterPrivate::showErrorReportCommand ( const SGPropertyNode * args,
SGPropertyNode *  )

Definition at line 616 of file ErrorReporter.cxx.

◆ writeContextToStream()

void flightgear::ErrorReporter::ErrorReporterPrivate::writeContextToStream ( const ErrorOcurrence & error,
std::ostream & os ) const

Definition at line 692 of file ErrorReporter.cxx.

◆ writeLogToStream()

void flightgear::ErrorReporter::ErrorReporterPrivate::writeLogToStream ( const ErrorOcurrence & error,
std::ostream & os ) const

Definition at line 700 of file ErrorReporter.cxx.

◆ writeReportToStream()

void flightgear::ErrorReporter::ErrorReporterPrivate::writeReportToStream ( const AggregateReport & report,
std::ostream & os ) const

Definition at line 539 of file ErrorReporter.cxx.

◆ writeSignificantPropertiesToStream()

void flightgear::ErrorReporter::ErrorReporterPrivate::writeSignificantPropertiesToStream ( std::ostream & os) const

Definition at line 583 of file ErrorReporter.cxx.

Member Data Documentation

◆ _activeErrorNode

SGPropertyNode_ptr flightgear::ErrorReporter::ErrorReporterPrivate::_activeErrorNode

Definition at line 178 of file ErrorReporter.cxx.

◆ _activeReportIndex

int flightgear::ErrorReporter::ErrorReporterPrivate::_activeReportIndex = -1

Definition at line 247 of file ErrorReporter.cxx.

◆ _aggregated

AggregateErrors flightgear::ErrorReporter::ErrorReporterPrivate::_aggregated

Definition at line 246 of file ErrorReporter.cxx.

◆ _aircraftDirectoryName

string flightgear::ErrorReporter::ErrorReporterPrivate::_aircraftDirectoryName

Definition at line 216 of file ErrorReporter.cxx.

◆ _displayNode

SGPropertyNode_ptr flightgear::ErrorReporter::ErrorReporterPrivate::_displayNode

Definition at line 177 of file ErrorReporter.cxx.

◆ _enabledNode

SGPropertyNode_ptr flightgear::ErrorReporter::ErrorReporterPrivate::_enabledNode

Definition at line 176 of file ErrorReporter.cxx.

◆ _fgdataPathPrefix

string flightgear::ErrorReporter::ErrorReporterPrivate::_fgdataPathPrefix

Definition at line 215 of file ErrorReporter.cxx.

◆ _haveDonePostInit

bool flightgear::ErrorReporter::ErrorReporterPrivate::_haveDonePostInit = false

Definition at line 174 of file ErrorReporter.cxx.

◆ _lock

std::mutex flightgear::ErrorReporter::ErrorReporterPrivate::_lock

Definition at line 172 of file ErrorReporter.cxx.

◆ _logCallback

std::unique_ptr<RecentLogCallback> flightgear::ErrorReporter::ErrorReporterPrivate::_logCallback

Definition at line 211 of file ErrorReporter.cxx.

◆ _logCallbackRegistered

bool flightgear::ErrorReporter::ErrorReporterPrivate::_logCallbackRegistered = false

Definition at line 212 of file ErrorReporter.cxx.

◆ _mpReportNode

SGPropertyNode_ptr flightgear::ErrorReporter::ErrorReporterPrivate::_mpReportNode

Definition at line 179 of file ErrorReporter.cxx.

◆ _nextShowTimeout

SGTimeStamp flightgear::ErrorReporter::ErrorReporterPrivate::_nextShowTimeout

Definition at line 173 of file ErrorReporter.cxx.

◆ _reportsDirty

bool flightgear::ErrorReporter::ErrorReporterPrivate::_reportsDirty = false

Definition at line 171 of file ErrorReporter.cxx.

◆ _significantProperties

string_list flightgear::ErrorReporter::ErrorReporterPrivate::_significantProperties

properties we want to include in reports, for debugging

Definition at line 248 of file ErrorReporter.cxx.

◆ _terrasyncPathPrefix

string flightgear::ErrorReporter::ErrorReporterPrivate::_terrasyncPathPrefix

Definition at line 214 of file ErrorReporter.cxx.


The documentation for this class was generated from the following file: