3 #if defined(_MSC_VER)
\r
4 #pragma warning (push)
\r
5 #pragma warning (disable : 4100)
\r
6 #pragma warning (disable : 4127) // conditional expression is constant
\r
7 #pragma warning (disable : 4512)
\r
8 #pragma warning (disable : 4714) // marked as __forceinline not inlined
\r
9 #pragma warning (disable : 4996) // _CRT_SECURE_NO_WARNINGS
\r
12 #include <boost/log/detail/prologue.hpp>
\r
13 #include <boost/log/keywords/severity.hpp>
\r
14 #include <boost/log/sources/global_logger_storage.hpp>
\r
15 #include <boost/log/sources/severity_logger.hpp>
\r
16 #include <boost/log/sources/record_ostream.hpp>
\r
18 #include "../utility/string_convert.h"
\r
20 namespace caspar { namespace log {
\r
26 void add_file_sink(const std::wstring& folder);
\r
38 template< typename CharT, typename TraitsT >
\r
39 inline std::basic_ostream< CharT, TraitsT >& operator<< (
\r
40 std::basic_ostream< CharT, TraitsT >& strm, severity_level lvl)
\r
44 else if(lvl == debug)
\r
46 else if(lvl == info)
\r
48 else if(lvl == warning)
\r
50 else if(lvl == error)
\r
52 else if(lvl == fatal)
\r
55 strm << static_cast<int>(lvl);
\r
60 typedef boost::log::sources::wseverity_logger_mt<severity_level> caspar_logger;
\r
62 BOOST_LOG_DECLARE_GLOBAL_LOGGER_INIT(logger, caspar_logger)
\r
65 return caspar_logger(boost::log::keywords::severity = trace);
\r
68 #define CASPAR_LOG(lvl)\
\r
69 BOOST_LOG_STREAM_WITH_PARAMS(::caspar::log::get_logger(),\
\r
70 (::boost::log::keywords::severity = ::caspar::log::lvl))
\r
72 #define CASPAR_LOG_CURRENT_EXCEPTION() \
\r
74 {CASPAR_LOG(error) << caspar::widen(boost::current_exception_diagnostic_information());}\
\r
79 #if defined(_MSC_VER)
\r
80 #pragma warning (pop)
\r