|
|
|
@ -35,16 +35,16 @@
|
|
|
|
|
|
|
|
|
|
namespace spdlog
|
|
|
|
|
{
|
|
|
|
|
namespace sinks
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
namespace sinks
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Sink that write to syslog using the `syscall()` library call.
|
|
|
|
|
*
|
|
|
|
|
* Locking is not needed, as `syslog()` itself is thread-safe.
|
|
|
|
|
*/
|
|
|
|
|
class syslog_sink : public sink
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
class syslog_sink : public sink
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
syslog_sink()
|
|
|
|
|
{
|
|
|
|
|
_priorities[static_cast<int>(level::TRACE)] = LOG_DEBUG;
|
|
|
|
@ -70,7 +70,7 @@ namespace spdlog
|
|
|
|
|
syslog(syslog_prio_from_level(msg), "%s", msg.formatted.str().c_str());
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
protected:
|
|
|
|
|
/**
|
|
|
|
|
* Simply maps spdlog's log level to syslog priority level.
|
|
|
|
|
*/
|
|
|
|
@ -79,10 +79,10 @@ namespace spdlog
|
|
|
|
|
return _priorities[static_cast<int>(msg.level)];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
private:
|
|
|
|
|
std::array<int, 11> _priorities;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|