stumpless 2.2.0
Loading...
Searching...
No Matches
FunctionTarget.hpp
Go to the documentation of this file.
1#ifndef __FUNCTIONTARGET_HPP
2#define __FUNCTIONTARGET_HPP
3
4#include <stumpless/target.h>
5#include <stumpless/target/function.h>
6#include <stumpless/Entry.hpp>
7
8namespace stumpless {
9
19 public:
20
21 struct stumpless_target *equivalent;
22
23 FunctionTarget( struct stumpless_target *equivalent );
38 FunctionTarget( const char *name, stumpless_log_func_t log_function );
51 const char *GetDefaultAppName( void );
59 const char *GetDefaultMsgid( void );
74 stumpless_filter_func_t GetFilter( void );
84 int GetMask( void );
92 const char *GetName( void );
103 int GetOption( int option );
109 bool IsOpen( void );
123 FunctionTarget& Log( const char *message, ... );
140 FunctionTarget& Log( int priority, const char *message, ... );
157 FunctionTarget& Log( Facility facility, Severity severity, const char *message, ... );
169 void Open( void );
177 FunctionTarget& SetDefaultAppName( const char *app_name );
194 FunctionTarget& SetDefaultMsgid( const char *msgid );
203 FunctionTarget& SetFilter( stumpless_filter_func_t filter );
223 FunctionTarget& SetOption( int option );
233 };
234
235}
236
237#endif
A log entry.
Definition Entry.hpp:19
A target allowing entries to be sent to a custom function.
Definition FunctionTarget.hpp:18
const char * GetName(void)
Returns the name of this target.
void Open(void)
Opens this target if it has been paused.
FunctionTarget(const char *name, stumpless_log_func_t log_function)
Creates a new target with the given function.
stumpless_filter_func_t GetFilter(void)
Returns the current filter used by this target to determine if entries should be allowed through it.
FunctionTarget & SetOption(int option)
Sets an option on a target.
~FunctionTarget(void)
Closes this target and releases all memory and other resources held by it.
FunctionTarget & UnsetOption(int option)
Unsets an option on a target.
int GetOption(int option)
Gets the given option for this target.
FunctionTarget & SetFilter(stumpless_filter_func_t filter)
Sets the filter used by this target to determine whether entries should be logged to it.
struct stumpless_target * equivalent
Definition FunctionTarget.hpp:21
FunctionTarget & Log(const char *message,...)
Writes a string message to this target.
const char * GetDefaultMsgid(void)
Returns the default msgid used by this target.
FunctionTarget & SetDefaultFacility(int facility)
Sets the default facility of the target.
bool IsOpen(void)
Checks to see if this target is open.
FunctionTarget & SetDefaultAppName(const char *app_name)
Sets the default app name for this target.
FunctionTarget & Log(int priority, const char *message,...)
Writes a log message with the given priority to this target.
Facility GetDefaultFacility(void)
Gets the default facility of this target.
int GetMask(void)
Gets the log mask of this target.
const char * GetDefaultAppName(void)
Returns the default app name used by this target.
FunctionTarget & Log(Facility facility, Severity severity, const char *message,...)
Writes a log message with the given facility and severity to this target.
FunctionTarget(struct stumpless_target *equivalent)
FunctionTarget & SetMask(int mask)
Sets the log mask of a target.
FunctionTarget & SetDefaultMsgid(const char *msgid)
Sets the default message id for this target.
FunctionTarget & Log(Entry entry)
Writes an Entry 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