mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-02-16 10:41:01 +00:00
35 lines
1.0 KiB
C++
35 lines
1.0 KiB
C++
#ifndef SENTRY_H
|
|
#define SENTRY_H
|
|
|
|
#include <sentry.h>
|
|
|
|
#include <string>
|
|
#include <mutex>
|
|
|
|
// TODO possibly use attach_stacktrace
|
|
|
|
// singleton, dont make this twice
|
|
class TSentry final {
|
|
public:
|
|
TSentry(const std::string& SentryUrl);
|
|
~TSentry();
|
|
|
|
void PrintWelcome();
|
|
void SetupUser();
|
|
void Log(sentry_level_t level, const std::string& logger, const std::string& text);
|
|
void LogError(const std::string& text, const std::string& file, const std::string& line);
|
|
void SetExtra(const std::string& key, const sentry_value_t& value);
|
|
void SetExtra(const std::string& key, const std::string& value);
|
|
void LogException(const std::exception& e, const std::string& file, const std::string& line);
|
|
void AddErrorBreadcrumb(const std::string& msg, const std::string& file, const std::string& line);
|
|
// cleared when Logged
|
|
void SetTransaction(const std::string& id);
|
|
[[nodiscard]] std::unique_lock<std::mutex> CreateExclusiveContext();
|
|
|
|
private:
|
|
bool mValid { true };
|
|
std::mutex mMutex;
|
|
};
|
|
|
|
#endif // SENTRY_H
|