stumpless 2.2.0
Loading...
Searching...
No Matches
FileTarget.hpp
Go to the documentation of this file.
1#ifndef __FILETARGET_HPP
2#define __FILETARGET_HPP
3
4#include <stumpless/target.h>
5#include <stumpless/Entry.hpp>
6
7namespace stumpless {
8
14 class FileTarget {
15 public:
16
17 static const char *DEFAULT_FILE;
18
19 struct stumpless_target *equivalent;
20
21 FileTarget( struct stumpless_target *equivalent );
31 FileTarget( const char *filename );
36 ~FileTarget( void );
44 const char *GetDefaultAppName( void );
52 const char *GetDefaultMsgid( void );
67 stumpless_filter_func_t GetFilter( void );
77 int GetMask( void );
85 const char *GetName( void );
96 int GetOption( int option );
102 bool IsOpen( void );
116 FileTarget& Log( const char *message, ... );
133 FileTarget& Log( int priority, const char *message, ... );
150 FileTarget& Log( Facility facility, Severity severity, const char *message, ... );
162 void Open( void );
170 FileTarget& SetDefaultAppName( const char *app_name );
187 FileTarget& SetDefaultMsgid( const char *msgid );
196 FileTarget& SetFilter( stumpless_filter_func_t filter );
208 FileTarget& SetMask( int mask );
216 FileTarget& SetOption( int option );
225 FileTarget& UnsetOption( int option );
226 };
227
228}
229
230#endif
A log entry.
Definition Entry.hpp:19
A target allowing logs to be written to a given file.
Definition FileTarget.hpp:14
~FileTarget(void)
Closes this target and releases all memory and other resources held by it.
FileTarget & SetDefaultMsgid(const char *msgid)
Sets the default message id for this target.
int GetOption(int option)
Gets the given option for this target.
FileTarget & UnsetOption(int option)
Unsets an option on a target.
FileTarget & SetOption(int option)
Sets an option on a target.
FileTarget & Log(Entry entry)
Writes an Entry to this target.
Facility GetDefaultFacility(void)
Gets the default facility of this target.
FileTarget & SetFilter(stumpless_filter_func_t filter)
Sets the filter used by this target to determine whether entries should be logged to it.
FileTarget & Log(const char *message,...)
Writes a string message to this target.
FileTarget(const char *filename)
Creates a new file target with the given options and default facility code which will log messages to...
const char * GetName(void)
Returns the name of this target.
FileTarget(struct stumpless_target *equivalent)
bool IsOpen(void)
Checks to see if this target is open.
FileTarget & SetDefaultFacility(int facility)
Sets the default facility of the target.
int GetMask(void)
Gets the log mask of this target.
FileTarget & SetDefaultAppName(const char *app_name)
Sets the default app name for this target.
const char * GetDefaultAppName(void)
Returns the default app name used by this target.
const char * GetDefaultMsgid(void)
Returns the default msgid used by this target.
FileTarget & Log(int priority, const char *message,...)
Writes a log message with the given priority to 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.
FileTarget & SetMask(int mask)
Sets the log mask of a target.
static const char * DEFAULT_FILE
Definition FileTarget.hpp:17
struct stumpless_target * equivalent
Definition FileTarget.hpp:19
void Open(void)
Opens this target if it has been paused.
FileTarget & Log(Facility facility, Severity severity, const char *message,...)
Writes a log message with the given facility and severity 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