Skip to content

Commit

Permalink
Support release tag (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-aimsun authored and nlohmann committed Apr 2, 2019
1 parent 1f38585 commit ded07ab
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions include/crow/crow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@ class crow
*/
const json& get_context() const;

/*!
* @brief set the code release id
*
* @param[in] release release id to add to the main context
*
* @since 0.0.7
*/
void set_release(const std::string& release);

/*!
* @brief add elements to the "user" context for future events
*
Expand Down
6 changes: 6 additions & 0 deletions src/crow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,12 @@ const json& crow::get_context() const
return m_payload;
}

void crow::set_release( const std::string & release )
{
std::lock_guard<std::mutex> lock(m_payload_mutex);
m_payload["release"] = release;
}

void crow::add_user_context(const json& data)
{
std::lock_guard<std::mutex> lock(m_payload_mutex);
Expand Down

0 comments on commit ded07ab

Please sign in to comment.