31#ifndef WEBSOCKETPP_LOGGER_SYSLOG_HPP
32#define WEBSOCKETPP_LOGGER_SYSLOG_HPP
36#include <websocketpp/logger/basic.hpp>
38#include <websocketpp/common/cpp11.hpp>
39#include <websocketpp/logger/levels.hpp>
45template <
typename concurrency,
typename names>
56 :
basic<concurrency,names>(hint), m_channel_type_hint(hint) {}
65 :
basic<concurrency,names>(channels, hint), m_channel_type_hint(hint) {}
72 void write(level channel, std::string
const & msg) {
73 write(channel, msg.c_str());
81 void write(level channel,
char const * msg) {
82 scoped_lock_type lock(base::m_lock);
83 if (!this->dynamic_test(channel)) {
return; }
84 ::syslog(syslog_priority(channel),
"[%s] %s",
85 names::channel_name(channel), msg);
88 typedef typename base::scoped_lock_type scoped_lock_type;
92 static int const default_level = LOG_INFO;
99 int syslog_priority(level channel)
const {
101 return syslog_priority_access(channel);
103 return syslog_priority_error(channel);
112 int syslog_priority_error(level channel)
const {
127 return default_level;
136 _WEBSOCKETPP_CONSTEXPR_TOKEN_
int syslog_priority_access(level)
const {
137 return default_level;
Basic logger that outputs to an ostream.
Basic logger that outputs to syslog.
void write(level channel, char const *msg)
Write a cstring message to the given channel.
void write(level channel, std::string const &msg)
Write a string message to the given channel.
Namespace for the WebSocket++ project.
static value const access
Access log.
uint32_t value
Type of a channel type hint value.
static level const devel
Low level debugging information (warning: very chatty)
static level const library
static level const rerror