Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
websocketpp::log::syslog< concurrency, names > Class Template Reference

Basic logger that outputs to syslog. More...

#include <syslog.hpp>

Inheritance diagram for websocketpp::log::syslog< concurrency, names >:
Collaboration diagram for websocketpp::log::syslog< concurrency, names >:

Public Types

typedef basic< concurrency, names > base
 

Public Member Functions

 syslog (channel_type_hint::value hint=channel_type_hint::access)
 Construct the logger.
 
 syslog (level channels, channel_type_hint::value hint=channel_type_hint::access)
 Construct the logger.
 
void write (level channel, std::string const &msg)
 Write a string message to the given channel.
 
void write (level channel, char const *msg)
 Write a cstring message to the given channel.
 
- Public Member Functions inherited from websocketpp::log::basic< concurrency, names >
 basic (channel_type_hint::value h=channel_type_hint::access)
 
 basic (std::ostream *out)
 
 basic (level c, channel_type_hint::value h=channel_type_hint::access)
 
 basic (level c, std::ostream *out)
 
 ~basic ()
 Destructor.
 
 basic (basic< concurrency, names > const &other)
 Copy constructor.
 
void set_ostream (std::ostream *out=&std::cout)
 
void set_channels (level channels)
 
void clear_channels (level channels)
 
void write (level channel, std::string const &msg)
 Write a string message to the given channel.
 
void write (level channel, char const *msg)
 Write a cstring message to the given channel.
 
_WEBSOCKETPP_CONSTEXPR_TOKEN_ bool static_test (level channel) const
 
bool dynamic_test (level channel)
 

Additional Inherited Members

- Protected Types inherited from websocketpp::log::basic< concurrency, names >
typedef concurrency::scoped_lock_type scoped_lock_type
 
typedef concurrency::mutex_type mutex_type
 
- Protected Attributes inherited from websocketpp::log::basic< concurrency, names >
mutex_type m_lock
 

Detailed Description

template<typename concurrency, typename names>
class websocketpp::log::syslog< concurrency, names >

Definition at line 46 of file syslog.hpp.

Member Typedef Documentation

◆ base

template<typename concurrency , typename names >
basic<concurrency, names> websocketpp::log::syslog< concurrency, names >::base

Definition at line 48 of file syslog.hpp.

Constructor & Destructor Documentation

◆ syslog() [1/2]

template<typename concurrency , typename names >
websocketpp::log::syslog< concurrency, names >::syslog ( channel_type_hint::value hint = channel_type_hint::access)
inline
Parameters
hintA channel type specific hint for how to construct the logger

Definition at line 48 of file syslog.hpp.

56 : basic<concurrency,names>(hint), m_channel_type_hint(hint) {}
basic(channel_type_hint::value h=channel_type_hint::access)
Definition basic.hpp:61
Here is the caller graph for this function:

◆ syslog() [2/2]

template<typename concurrency , typename names >
websocketpp::log::syslog< concurrency, names >::syslog ( level channels,
channel_type_hint::value hint = channel_type_hint::access )
inline
Parameters
channelsA set of channels to statically enable
hintA channel type specific hint for how to construct the logger

Definition at line 48 of file syslog.hpp.

65 : basic<concurrency,names>(channels, hint), m_channel_type_hint(hint) {}

Member Function Documentation

◆ write() [1/2]

template<typename concurrency , typename names >
void websocketpp::log::syslog< concurrency, names >::write ( level channel,
char const * msg )
inline
Parameters
channelThe channel to write to
msgThe message to write

Definition at line 81 of file syslog.hpp.

81 {
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);
86 }
bool dynamic_test(level channel)
Definition basic.hpp:164
syslog(channel_type_hint::value hint=channel_type_hint::access)
Construct the logger.
Definition syslog.hpp:54
void lock()
Here is the call graph for this function:

◆ write() [2/2]

template<typename concurrency , typename names >
void websocketpp::log::syslog< concurrency, names >::write ( level channel,
std::string const & msg )
inline
Parameters
channelThe channel to write to
msgThe message to write

Definition at line 72 of file syslog.hpp.

72 {
73 write(channel, msg.c_str());
74 }
void write(level channel, std::string const &msg)
Write a string message to the given channel.
Definition syslog.hpp:72
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: