10 #ifdef SPDLOG_ENABLE_SYSLOG 29 class syslog_sink :
public sink
33 syslog_sink(
const std::string& ident =
"",
int syslog_option=0,
int syslog_facility=LOG_USER):
39 _priorities[
static_cast<int>(
level::warn)] = LOG_WARNING;
40 _priorities[
static_cast<int>(
level::err)] = LOG_ERR;
45 ::openlog(_ident.empty()?
nullptr:_ident.c_str(), syslog_option, syslog_facility);
52 syslog_sink(
const syslog_sink&) =
delete;
53 syslog_sink& operator=(
const syslog_sink&) =
delete;
55 void log(
const details::log_msg &msg)
override 57 ::syslog(syslog_prio_from_level(msg),
"%s", msg.raw.str().c_str());
66 std::array<int, 7> _priorities;
73 int syslog_prio_from_level(
const details::log_msg &msg)
const 75 return _priorities[
static_cast<int>(msg.level)];
#define LOG_DEBUG(__logger__,...)
OStream< ChannelType > & flush(OStream< ChannelType > &os)
#define LOG_INFO(__logger__,...)