From 154b84413050cdb03f281c42861b9af6eaef7d14 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Mon, 24 Aug 2015 21:01:00 -1000 Subject: [PATCH] Removed exceptions completely --- include/LogVisor/LogVisor.hpp | 39 ----------------------------------- 1 file changed, 39 deletions(-) diff --git a/include/LogVisor/LogVisor.hpp b/include/LogVisor/LogVisor.hpp index 06877dd..255b5f8 100644 --- a/include/LogVisor/LogVisor.hpp +++ b/include/LogVisor/LogVisor.hpp @@ -7,8 +7,6 @@ #include #include #include -#include -#include namespace LogVisor { @@ -17,35 +15,6 @@ namespace LogVisor #define LOG_UCS2 1 #endif -#if LOG_VISOR_EXCEPTIONS -/** - * @brief Exception thrown when FatalError is issued - */ -class FatalException : public std::exception -{ - std::string m_what; -public: - FatalException(const char* format, va_list ap) - { - char buf[1024]; - vsnprintf(buf, 1024, format, ap); - m_what.assign(buf); - } - FatalException(const wchar_t* format, va_list ap) - { - wchar_t buf[1024]; - vswprintf(buf, 1024, format, ap); - std::wstring_convert> conv; - m_what.assign(conv.to_bytes(buf)); - } -#if _MSC_VER - inline const char* what() const {return m_what.c_str();} -#else - inline const char* what() const noexcept {return m_what.c_str();} -#endif -}; -#endif - /** * @brief Severity level for log messages */ @@ -166,11 +135,7 @@ public: for (auto& logger : MainLoggers) logger->report(m_modName, severity, format, ap); if (severity == FatalError) -#if LOG_VISOR_EXCEPTIONS - throw FatalException(format, ap); -#else abort(); -#endif else if (severity == Error) ++ErrorCount; } @@ -197,11 +162,7 @@ public: for (auto& logger : MainLoggers) logger->reportSource(m_modName, severity, file, linenum, format, ap); if (severity == FatalError) -#if LOG_VISOR_EXCEPTIONS - throw FatalException(format, ap); -#else abort(); -#endif else if (severity == Error) ++ErrorCount; }