exception.hpp: Add assert_trip debug logging for exceptions

This commit is contained in:
theoreticalbts 2015-07-01 16:24:09 -04:00
parent e2e0f38dc6
commit 46d85a3462

View file

@ -6,9 +6,10 @@
#include <fc/log/logger.hpp>
#include <fc/optional.hpp>
#include <exception>
#include <functional>
#include <iostream>
#include <unordered_map>
namespace fc
{
namespace detail { class exception_impl; }
@ -291,7 +292,6 @@ namespace fc
FC_DECLARE_EXCEPTION( underflow_exception, underflow_code, "Integer Underflow" );
std::string except_str();
} // namespace fc
#if __APPLE__
@ -313,7 +313,10 @@ namespace fc
FC_EXPAND_MACRO( \
FC_MULTILINE_MACRO_BEGIN \
if( UNLIKELY(!(TEST)) ) \
{ \
std::cout << "assert_trip: " << __FILE__ << ':' << __LINE__ << ": " << #TEST << "\n"; \
FC_THROW_EXCEPTION( fc::assert_exception, #TEST ": " __VA_ARGS__ ); \
} \
FC_MULTILINE_MACRO_END \
)