Tweaks to sentry integration
Report menu item activation, and define a RAII helper for setting the XML error reporting state.
This commit is contained in:
parent
c85916d88d
commit
a0ff4adbc6
3 changed files with 30 additions and 10 deletions
|
@ -8,9 +8,10 @@
|
||||||
#include <simgear/structure/SGBinding.hxx>
|
#include <simgear/structure/SGBinding.hxx>
|
||||||
#include <simgear/props/props_io.hxx>
|
#include <simgear/props/props_io.hxx>
|
||||||
|
|
||||||
|
#include <Main/fg_props.hxx>
|
||||||
#include <Main/globals.hxx>
|
#include <Main/globals.hxx>
|
||||||
#include <Main/locale.hxx>
|
#include <Main/locale.hxx>
|
||||||
#include <Main/fg_props.hxx>
|
#include <Main/sentryIntegration.hxx>
|
||||||
|
|
||||||
#include "new_gui.hxx"
|
#include "new_gui.hxx"
|
||||||
#include "FGPUIMenuBar.hxx"
|
#include "FGPUIMenuBar.hxx"
|
||||||
|
@ -161,6 +162,8 @@ FGPUIMenuBar::fireItem (puObject * item)
|
||||||
vector<SGBinding *> &bindings = _bindings[name];
|
vector<SGBinding *> &bindings = _bindings[name];
|
||||||
int nBindings = bindings.size();
|
int nBindings = bindings.size();
|
||||||
|
|
||||||
|
flightgear::addSentryBreadcrumb("fire menu item:" + string{item->getLabel()}, "info");
|
||||||
|
|
||||||
for (int i = 0; i < nBindings; i++)
|
for (int i = 0; i < nBindings; i++)
|
||||||
bindings[i]->fire();
|
bindings[i]->fire();
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,15 +62,15 @@ auto OSG_messageWhitelist = {
|
||||||
};
|
};
|
||||||
|
|
||||||
auto XML_messageWhitelist = {
|
auto XML_messageWhitelist = {
|
||||||
"Cannot open file",
|
"Cannot open file",
|
||||||
"not well-formed (invalid token)",
|
"not well-formed (invalid token)",
|
||||||
"mismatched tag",
|
"mismatched tag",
|
||||||
"syntax error",
|
"syntax error",
|
||||||
"no element found",
|
"no element found",
|
||||||
"Root element name is",
|
"Root element name is",
|
||||||
"XML or text declaration not at start of entity",
|
"XML or text declaration not at start of entity",
|
||||||
"Failed to open file"
|
"Failed to open file",
|
||||||
};
|
"unclosed token"};
|
||||||
|
|
||||||
auto exception_messageWhitelist = {
|
auto exception_messageWhitelist = {
|
||||||
"position is invalid, NaNs", ///< avoid spam when NaNs occur
|
"position is invalid, NaNs", ///< avoid spam when NaNs occur
|
||||||
|
@ -552,4 +552,14 @@ void addSentryTag(const std::string& tag, const std::string& value)
|
||||||
addSentryTag(tag.c_str(), value.c_str());
|
addSentryTag(tag.c_str(), value.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SentryXMLErrorSupression::SentryXMLErrorSupression()
|
||||||
|
{
|
||||||
|
sentryThreadReportXMLErrors(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
SentryXMLErrorSupression::~SentryXMLErrorSupression()
|
||||||
|
{
|
||||||
|
sentryThreadReportXMLErrors(true);
|
||||||
|
}
|
||||||
|
|
||||||
} // of namespace flightgear
|
} // of namespace flightgear
|
||||||
|
|
|
@ -56,5 +56,12 @@ void sentryReportFatalError(const std::string& msg, const std::string& more = {}
|
||||||
*/
|
*/
|
||||||
void sentryThreadReportXMLErrors(bool report);
|
void sentryThreadReportXMLErrors(bool report);
|
||||||
|
|
||||||
|
class SentryXMLErrorSupression
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SentryXMLErrorSupression();
|
||||||
|
~SentryXMLErrorSupression();
|
||||||
|
};
|
||||||
|
|
||||||
} // of namespace flightgear
|
} // of namespace flightgear
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue