This commit is contained in:
gabime 2014-12-20 19:00:34 +02:00
commit 6ec8c597b6
4 changed files with 15 additions and 6 deletions

View File

@ -27,12 +27,21 @@
#include<initializer_list>
#include<chrono>
//visual studio does not support noexcept yet
#ifndef _MSC_VER
#define SPDLOG_NOEXCEPT noexcept
#else
#define SPDLOG_NOEXCEPT
#endif
namespace spdlog
{
class formatter;
namespace sinks { class sink;}
namespace sinks {
class sink;
}
// Common types across the lib
using log_clock = std::chrono::system_clock;
@ -71,8 +80,8 @@ inline const char* to_str(spdlog::level::level_enum l)
class spdlog_ex : public std::exception
{
public:
spdlog_ex(const std::string& msg) :_msg(msg) {};
const char* what() const throw() override
spdlog_ex(const std::string& msg) :_msg(msg) {}
const char* what() const SPDLOG_NOEXCEPT override
{
return _msg.c_str();
}

View File

@ -51,7 +51,7 @@ public:
explicit file_helper(bool auto_flush):
_fd(nullptr),
_auto_flush(auto_flush)
{};
{}
file_helper(const file_helper&) = delete;
file_helper& operator=(const file_helper&) = delete;

View File

@ -56,7 +56,7 @@ public:
{
std::lock_guard<Mutex> lock(_mutex);
_sink_it(msg);
};
}
protected:

View File

@ -75,7 +75,7 @@ public:
void log(const details::log_msg &msg) override
{
::syslog(syslog_prio_from_level(msg), "%s", msg.formatted.str().c_str());
};
}