30 #ifndef NLOHMANN_CROW_HPP 31 #define NLOHMANN_CROW_HPP 35 #include <thirdparty/json/json.hpp> 37 using json = nlohmann::json;
73 explicit crow(
const std::string& dsn,
74 const json& context =
nullptr,
75 bool install_handlers =
true);
122 const json& attributes =
nullptr,
123 bool asynchronous =
true);
138 const json& context =
nullptr,
139 bool asynchronous =
true,
140 bool handled =
true);
151 const json& attributes =
nullptr);
248 std::string post(json payload)
const;
250 void enqueue_post(
bool asynchronous);
257 static void new_termination_handler();
261 const bool m_enabled =
true;
263 std::string m_public_key;
265 std::string m_secret_key;
267 std::string m_store_url;
271 mutable std::future<std::string> m_pending_future;
273 std::terminate_handler existing_termination_handler =
nullptr;
275 std::mutex m_payload_mutex;
277 mutable std::mutex m_pending_future_mutex;
279 static crow* m_client_that_installed_termination_handler;
void add_user_context(const json &data)
add elements to the "user" context for future events
void add_request_context(const json &data)
add elements to the "request" context for future events
const json & get_context() const
return current context
void merge_context(const json &context)
add context information to payload for future events
void install_handler()
install termination handler to handle uncaught exceptions
crow(const std::string &dsn, const json &context=nullptr, bool install_handlers=true)
create a client
void add_extra_context(const json &data)
add elements to the "extra" context for future events
void capture_exception(const std::exception &exception, const json &context=nullptr, bool asynchronous=true, bool handled=true)
capture an exception
std::string get_last_event_id() const
return the id of the last reported event
namespace for Niels Lohmann
void clear_context()
reset context for future events
void add_breadcrumb(const std::string &message, const json &attributes=nullptr)
add a breadcrumb to the current context
void capture_message(const std::string &message, const json &attributes=nullptr, bool asynchronous=true)
capture a message
void add_tags_context(const json &data)
add elements to the "tags" context for future events