diff options
author | Cara Salter <cara@devcara.com> | 2023-04-06 21:43:29 -0400 |
---|---|---|
committer | Cara Salter <cara@devcara.com> | 2023-04-06 21:43:29 -0400 |
commit | acd1befde66db492149992199fadca92e55cc97b (patch) | |
tree | 16251d96cd8efd5323fa8f095bb29f110030f387 /src/db.cpp | |
parent | 555810bedc0cf9d9d954f56b5a2c8c92522ad27f (diff) | |
download | 142bot-acd1befde66db492149992199fadca92e55cc97b.tar.gz 142bot-acd1befde66db492149992199fadca92e55cc97b.zip |
sentry: Add sentry support
Change-Id: I3cff2a05c63e88abddc8eff6a3ee9a9f73a5172d
Diffstat (limited to 'src/db.cpp')
-rw-r--r-- | src/db.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -24,6 +24,7 @@ #include <pqxx/pqxx> #include <fmt/format.h> #include <cstdarg> +#include <sentry.h> using namespace std; @@ -36,6 +37,7 @@ namespace db { **/ pqxx::connection connect(const std::string &host, const std::string &user, const std::string &pass, const std::string &db, int port) { std::lock_guard<std::mutex> db_lock(db_mutex); + std::string cn_s = "postgresql://"; @@ -60,6 +62,11 @@ namespace db { cn_s = cn_s + "/" + db; } + sentry_value_t crumb = sentry_value_new_breadcrumb("default", "Started Database Connection"); + sentry_value_set_by_key(crumb, "level", sentry_value_new_string("db")); + sentry_value_set_by_key(crumb, "data", sentry_value_new_string(cn_s.c_str())); + sentry_add_breadcrumb(crumb); + try { pqxx::connection c{cn_s}; return c; |