Skip to content

Commit

Permalink
Use Cura Sentry preference
Browse files Browse the repository at this point in the history
Contribute to CURA-11482
  • Loading branch information
jellespijker committed Jan 13, 2024
1 parent b08ec64 commit a7eac67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/communication/ArcusCommunication.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2023 UltiMaker
// Copyright (c) 2024 UltiMaker
// CuraEngine is released under the terms of the AGPLv3 or higher

#ifdef ARCUS
Expand Down Expand Up @@ -536,7 +536,8 @@ void ArcusCommunication::sliceNext()
sentry_value_set_by_key(user, "id", sentry_value_new_string(slice_message->sentry_id().c_str()));
if (const auto sentry_user = spdlog::details::os::getenv("CURAENGINE_SENTRY_USER"); ! sentry_user.empty())
{
sentry_value_set_by_key(user, "email", sentry_value_new_string(sentry_user.c_str()));
spdlog::debug("Setting Sentry user to {}", sentry_user);
sentry_value_set_by_key(user, "username", sentry_value_new_string(sentry_user.c_str()));
}
sentry_set_user(user);
sentry_set_tag("cura.version", slice_message->cura_version().c_str());
Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ int main(int argc, char** argv)

// Want to set the sentry URL? Use '-c user.curaengine:sentry_url=<url> -o curaengine:enable_sentry=True' with conan install
#ifdef SENTRY_URL
if (const auto use_sentry = spdlog::details::os::getenv("use_sentry"); ! use_sentry.empty() && use_sentry == "1")
if (const auto use_sentry = spdlog::details::os::getenv("USE_SENTRY"); ! use_sentry.empty() && use_sentry == "1")
{
// Setup sentry error handling.
sentry_options_t* options = sentry_options_new();
Expand Down Expand Up @@ -101,7 +101,7 @@ int main(int argc, char** argv)
cura::Application::getInstance().run(argc, argv);

#ifdef SENTRY_URL
if (const auto use_sentry = spdlog::details::os::getenv("use_sentry"); ! use_sentry.empty() && use_sentry == "1")
if (const auto use_sentry = spdlog::details::os::getenv("USE_SENTRY"); ! use_sentry.empty() && use_sentry == "1")
{
spdlog::info("Closing sentry");
sentry_close();
Expand Down

0 comments on commit a7eac67

Please sign in to comment.