stumpless 2.2.0
Loading...
Searching...
No Matches
ChainTarget.hpp
Go to the documentation of this file.
1#ifndef __CHAINTARGET_HPP
2#define __CHAINTARGET_HPP
3
4#include <stumpless/target.h>
5#include <stumpless/Entry.hpp>
6
7namespace stumpless {
8
13 public:
14
15 struct stumpless_target *equivalent;
16
17 ChainTarget( struct stumpless_target *equivalent );
23 ChainTarget( const char *name );
28 ~ChainTarget( void );
36 const char *GetDefaultAppName( void );
44 const char *GetDefaultMsgid( void );
59 stumpless_filter_func_t GetFilter( void );
69 int GetMask( void );
77 const char *GetName( void );
88 int GetOption( int option );
94 bool IsOpen( void );
108 ChainTarget& Log( const char *message, ... );
125 ChainTarget& Log( int priority, const char *message, ... );
142 ChainTarget& Log( Facility facility, Severity severity, const char *message, ... );
154 void Open( void );
162 ChainTarget& SetDefaultAppName( const char *app_name );
179 ChainTarget& SetDefaultMsgid( const char *msgid );
188 ChainTarget& SetFilter( stumpless_filter_func_t filter );
200 ChainTarget& SetMask( int mask );
208 ChainTarget& SetOption( int option );
217 ChainTarget& UnsetOption( int option );
218 };
219
220}
221
222#endif
A target allowing entries to be sent to a sequence of targets.
Definition ChainTarget.hpp:12
ChainTarget & Log(Facility facility, Severity severity, const char *message,...)
Writes a log message with the given facility and severity to this target.
bool IsOpen(void)
Checks to see if this target is open.
ChainTarget & Log(const char *message,...)
Writes a string message to this target.
~ChainTarget(void)
Closes this chain and releases all memory and other resources held by it.
int GetMask(void)
Gets the log mask of this target.
ChainTarget & SetMask(int mask)
Sets the log mask of a target.
ChainTarget & SetOption(int option)
Sets an option on a target.
ChainTarget(const char *name)
Creates a new chain target.
ChainTarget(struct stumpless_target *equivalent)
Facility GetDefaultFacility(void)
Gets the default facility of this target.
int GetOption(int option)
Gets the given option for this target.
ChainTarget & Log(Entry entry)
Writes an Entry to this target.
ChainTarget & SetDefaultMsgid(const char *msgid)
Sets the default message id for this target.
ChainTarget & SetDefaultFacility(int facility)
Sets the default facility of the target.
void Open(void)
Opens this target if it has been paused.
ChainTarget & SetDefaultAppName(const char *app_name)
Sets the default app name for this target.
ChainTarget & SetFilter(stumpless_filter_func_t filter)
Sets the filter used by this target to determine whether entries should be logged to it.
const char * GetName(void)
Returns the name of this target.
const char * GetDefaultMsgid(void)
Returns the default msgid used by 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.
struct stumpless_target * equivalent
Definition ChainTarget.hpp:15
ChainTarget & UnsetOption(int option)
Unsets an option on a target.
ChainTarget & Log(int priority, const char *message,...)
Writes a log message with the given priority to this target.
const char * GetDefaultAppName(void)
Returns the default app name used by this target.
A log entry.
Definition Entry.hpp:19
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