GODT-2157: Add Sentry to Bridge-Gui

This commit is contained in:
Leander Beernaert
2022-11-28 13:36:36 +01:00
committed by Romain Le Jeune
parent 1c374b59d3
commit 2747f3b492
9 changed files with 123 additions and 6 deletions

View File

@ -0,0 +1,31 @@
// Copyright (c) 2022 Proton AG
//
// This file is part of Proton Mail Bridge.
//
// Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
#include "SentryUtils.h"
static constexpr const char* LoggerName = "bridge-gui";
void reportSentryEvent(sentry_level_t level, const char* message) {
auto event = sentry_value_new_message_event(level, LoggerName, message);
sentry_capture_event(event);
}
void reportSentryException(sentry_level_t level, const char* message, const char* exceptionType, const char* exception) {
auto event = sentry_value_new_message_event(level, LoggerName, message);
sentry_event_add_exception(event, sentry_value_new_exception(exceptionType, exception));
sentry_capture_event(event);
}