boost::log::core::get()->add_sink(stream_sink);
}
+std::string current_exception_diagnostic_information()
+{
+ auto e = boost::current_exception_cast<const char*>();
+
+ if (e)
+ return std::string("[char *] = ") + *e + "\n";
+ else
+ return boost::current_exception_diagnostic_information();
+}
+
}
void add_file_sink(const std::wstring& file, const boost::log::filter& filter)
namespace internal{
void init();
std::wstring get_call_stack();
+std::string current_exception_diagnostic_information();
}
const char* remove_source_prefix(const char* file);
catch(...){}
#define CASPAR_LOG_CURRENT_EXCEPTION() try{\
- CASPAR_LOG(error) << caspar::u16(boost::current_exception_diagnostic_information()) << L"Caught at (" << caspar::get_thread_info().name << L"):\n" << caspar::get_call_stack();\
+ CASPAR_LOG(error) << caspar::u16(::caspar::log::internal::current_exception_diagnostic_information()) << L"Caught at (" << caspar::get_thread_info().name << L"):\n" << caspar::get_call_stack();\
}\
catch(...){}
#define CASPAR_LOG_CURRENT_EXCEPTION_AT_LEVEL(lvl) try{\
- CASPAR_LOG(lvl) << caspar::u16(boost::current_exception_diagnostic_information()) << L"Caught at (" << caspar::get_thread_info().name << L"):\n" << caspar::get_call_stack();\
+ CASPAR_LOG(lvl) << caspar::u16(::caspar::log::internal::current_exception_diagnostic_information()) << L"Caught at (" << caspar::get_thread_info().name << L"):\n" << caspar::get_call_stack();\
}\
catch(...){}
{
RaiseException( 0x406D1388, 0, sizeof(info)/sizeof(ULONG_PTR), (ULONG_PTR*)&info );
}
- __except (EXCEPTION_CONTINUE_EXECUTION){}
+ __except (EXCEPTION_CONTINUE_EXECUTION){}
}
} // namespace detail
static boost::thread_specific_ptr<bool> installed;
auto for_thread = installed.get();
-
+
if (!for_thread)
{
for_thread = new bool(false);
{
case EXCEPTION_ACCESS_VIOLATION:
CASPAR_THROW_EXCEPTION(win32_access_violation() << generate_message(*(pInfo->ExceptionRecord)));
+ case EXCEPTION_STACK_OVERFLOW:
+ throw "Stack overflow. Not generating stack trace to protect from further overflowing the stack";
default:
CASPAR_THROW_EXCEPTION(win32_exception() << generate_message(*(pInfo->ExceptionRecord)));
}