stumpless 2.2.0
Loading...
Searching...
No Matches
SocketTarget.hpp
Go to the documentation of this file.
1#ifndef __SOCKETTARGET_HPP
2#define __SOCKETTARGET_HPP
3
4#include <stumpless/target.h>
5#include <stumpless/Entry.hpp>
6
7namespace stumpless {
8
15 public:
16
20 static const char *DEFAULT_SOCKET;
21
22 struct stumpless_target *equivalent;
23
24 SocketTarget( struct stumpless_target *equivalent );
34 SocketTarget( const char *name, const char *local_socket );
48 const char *GetDefaultAppName( void );
56 const char *GetDefaultMsgid( void );
71 stumpless_filter_func_t GetFilter( void );
81 int GetMask( void );
89 const char *GetName( void );
100 int GetOption( int option );
106 bool IsOpen( void );
120 SocketTarget& Log( const char *message, ... );
137 SocketTarget& Log( int priority, const char *message, ... );
154 SocketTarget& Log( Facility facility, Severity severity, const char *message, ... );
166 void Open( void );
174 SocketTarget& SetDefaultAppName( const char *app_name );
191 SocketTarget& SetDefaultMsgid( const char *msgid );
200 SocketTarget& SetFilter( stumpless_filter_func_t filter );
212 SocketTarget& SetMask( int mask );
220 SocketTarget& SetOption( int option );
229 SocketTarget& UnsetOption( int option );
230 };
231
232}
233
234#endif
A log entry.
Definition Entry.hpp:19
Socket targets allow logs to be sent to a Unix domain socket, like the frequently used /dev/log or /v...
Definition SocketTarget.hpp:14
~SocketTarget(void)
Closes this target and releases all memory and other resources held by it.
SocketTarget & SetDefaultAppName(const char *app_name)
Sets the default app name for this target.
struct stumpless_target * equivalent
Definition SocketTarget.hpp:22
SocketTarget(struct stumpless_target *equivalent)
SocketTarget & Log(Entry entry)
Writes an Entry to this target.
SocketTarget & SetOption(int option)
Sets an option on a target.
SocketTarget & SetDefaultFacility(int facility)
Sets the default facility of the target.
int GetOption(int option)
Gets the given option for this target.
bool IsOpen(void)
Checks to see if this target is open.
SocketTarget & UnsetOption(int option)
Unsets an option on a target.
SocketTarget & SetFilter(stumpless_filter_func_t filter)
Sets the filter used by this target to determine whether entries should be logged to it.
SocketTarget & SetMask(int mask)
Sets the log mask of a target.
static const char * DEFAULT_SOCKET
A string literal with the default socket logged to.
Definition SocketTarget.hpp:20
SocketTarget & SetDefaultMsgid(const char *msgid)
Sets the default message id for this target.
stumpless_filter_func_t GetFilter(void)
Returns the current filter used by this target to determine if entries should be allowed through it.
const char * GetDefaultAppName(void)
Returns the default app name used by this target.
const char * GetName(void)
Returns the name of this target.
const char * GetDefaultMsgid(void)
Returns the default msgid used by this target.
SocketTarget(const char *name, const char *local_socket)
Opens a socket target.
SocketTarget & Log(Facility facility, Severity severity, const char *message,...)
Writes a log message with the given facility and severity to this target.
Facility GetDefaultFacility(void)
Gets the default facility of this target.
SocketTarget & Log(int priority, const char *message,...)
Writes a log message with the given priority to this target.
void Open(void)
Opens this target if it has been paused.
int GetMask(void)
Gets the log mask of this target.
SocketTarget & Log(const char *message,...)
Writes a string message to this target.
Definition AddressFailure.hpp:7
Facility
Facilities (as defined in RFC 5424) describe the general classification of an event.
Definition Facility.hpp:17
Severity
Severities (as defined in RFC 5424) describe the level of importance of a given log entry.
Definition Severity.hpp:15