mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-01 23:35:41 +00:00
Senty: add threadname to context
This commit is contained in:
parent
8fada3ac04
commit
9f52ab2e54
@ -73,7 +73,7 @@ private:
|
||||
static inline std::deque<TShutdownHandler> mShutdownHandlers {};
|
||||
};
|
||||
|
||||
std::string ThreadName();
|
||||
std::string ThreadName(bool DebugModeOverride = false);
|
||||
void RegisterThread(const std::string str);
|
||||
#define RegisterThreadAuto() RegisterThread(__func__)
|
||||
|
||||
|
@ -73,8 +73,8 @@ std::string DeComp(std::string Compressed) {
|
||||
|
||||
std::map<std::thread::id, std::string> threadNameMap;
|
||||
|
||||
std::string ThreadName() {
|
||||
if (Application::Settings.DebugModeEnabled) {
|
||||
std::string ThreadName(bool DebugModeOverride) {
|
||||
if (DebugModeOverride || Application::Settings.DebugModeEnabled) {
|
||||
auto id = std::this_thread::get_id();
|
||||
if (threadNameMap.find(id) != threadNameMap.end()) {
|
||||
// found
|
||||
|
@ -39,6 +39,7 @@ void TSentry::Log(sentry_level_t level, const std::string& logger, const std::st
|
||||
if (!mValid) {
|
||||
return;
|
||||
}
|
||||
SetContext("threads", { { "thread-name", ThreadName(true) } });
|
||||
auto Msg = sentry_value_new_message_event(level, logger.c_str(), text.c_str());
|
||||
sentry_capture_event(Msg);
|
||||
sentry_remove_transaction();
|
||||
|
Loading…
x
Reference in New Issue
Block a user