Commit 6ec8c597 authored by gabime's avatar gabime

Merge branch 'master' of https://github.com/gabime/spdlog

parents eda9499d 1e781429
...@@ -27,12 +27,21 @@ ...@@ -27,12 +27,21 @@
#include<initializer_list> #include<initializer_list>
#include<chrono> #include<chrono>
//visual studio does not support noexcept yet
#ifndef _MSC_VER
#define SPDLOG_NOEXCEPT noexcept
#else
#define SPDLOG_NOEXCEPT
#endif
namespace spdlog namespace spdlog
{ {
class formatter; class formatter;
namespace sinks { class sink;} namespace sinks {
class sink;
}
// Common types across the lib // Common types across the lib
using log_clock = std::chrono::system_clock; using log_clock = std::chrono::system_clock;
...@@ -71,8 +80,8 @@ inline const char* to_str(spdlog::level::level_enum l) ...@@ -71,8 +80,8 @@ inline const char* to_str(spdlog::level::level_enum l)
class spdlog_ex : public std::exception class spdlog_ex : public std::exception
{ {
public: public:
spdlog_ex(const std::string& msg) :_msg(msg) {}; spdlog_ex(const std::string& msg) :_msg(msg) {}
const char* what() const throw() override const char* what() const SPDLOG_NOEXCEPT override
{ {
return _msg.c_str(); return _msg.c_str();
} }
......
...@@ -51,7 +51,7 @@ public: ...@@ -51,7 +51,7 @@ public:
explicit file_helper(bool auto_flush): explicit file_helper(bool auto_flush):
_fd(nullptr), _fd(nullptr),
_auto_flush(auto_flush) _auto_flush(auto_flush)
{}; {}
file_helper(const file_helper&) = delete; file_helper(const file_helper&) = delete;
file_helper& operator=(const file_helper&) = delete; file_helper& operator=(const file_helper&) = delete;
......
...@@ -56,7 +56,7 @@ public: ...@@ -56,7 +56,7 @@ public:
{ {
std::lock_guard<Mutex> lock(_mutex); std::lock_guard<Mutex> lock(_mutex);
_sink_it(msg); _sink_it(msg);
}; }
protected: protected:
......
...@@ -75,7 +75,7 @@ public: ...@@ -75,7 +75,7 @@ public:
void log(const details::log_msg &msg) override void log(const details::log_msg &msg) override
{ {
::syslog(syslog_prio_from_level(msg), "%s", msg.formatted.str().c_str()); ::syslog(syslog_prio_from_level(msg), "%s", msg.formatted.str().c_str());
}; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment