\r
namespace internal{\r
void init();\r
+std::wstring get_call_stack();\r
}\r
\r
void add_file_sink(const std::wstring& folder);\r
BOOST_LOG_STREAM_WITH_PARAMS(::caspar::log::get_logger(),\\r
(::boost::log::keywords::severity = ::caspar::log::lvl))\r
\r
-#define CASPAR_LOG_CURRENT_EXCEPTION() \\r
- try\\r
- {CASPAR_LOG(error) << caspar::u16(boost::current_exception_diagnostic_information());}\\r
+#define CASPAR_LOG_CALL_STACK() try{\\r
+ CASPAR_LOG(info) << L"callstack:\n" << caspar::log::internal::get_call_stack();\\r
+ }\\r
catch(...){}\r
\r
+#define CASPAR_LOG_CURRENT_EXCEPTION() try{\\r
+ CASPAR_LOG(error) << caspar::u16(boost::current_exception_diagnostic_information()) << L"Caught at:\n" << caspar::log::internal::get_call_stack();\\r
+ }\\r
+ catch(...){}\r
+ \r
void set_log_level(const std::wstring& lvl);\r
\r
-template<typename T>\r
-inline void replace_nonprintable(std::basic_string<T, std::char_traits<T>, std::allocator<T>>& str, T with)\r
-{\r
- std::locale loc;\r
- std::replace_if(str.begin(), str.end(), [&](T c)->bool { return !std::isprint(c, loc) && c != '\r' && c != '\n'; }, with);\r
-}\r
-\r
-template<typename T>\r
-inline std::basic_string<T> replace_nonprintable_copy(std::basic_string<T, std::char_traits<T>, std::allocator<T>> str, T with)\r
-{\r
- replace_nonprintable(str, with);\r
- return str;\r
-}\r
-\r
}}\r
\r
#if defined(_MSC_VER)\r