stumpless 2.2.0
Loading...
Searching...
No Matches
StreamTarget.hpp
Go to the documentation of this file.
1#ifndef __STREAMTARGET_HPP
2#define __STREAMTARGET_HPP
3
4#include <stumpless/target.h>
5#include <stdio.h>
6#include <stumpless/Entry.hpp>
7
8namespace stumpless {
9
19 public:
20
21 struct stumpless_target *equivalent;
22
23 StreamTarget( struct stumpless_target *equivalent );
31 StreamTarget( const char *name, FILE *stream );
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 StreamTarget& Log( const char *message, ... );
133 StreamTarget& Log( int priority, const char *message, ... );
150 StreamTarget& Log( Facility facility, Severity severity, const char *message, ... );
162 void Open( void );
170 StreamTarget& SetDefaultAppName( const char *app_name );
187 StreamTarget& SetDefaultMsgid( const char *msgid );
196 StreamTarget& SetFilter( stumpless_filter_func_t filter );
208 StreamTarget& SetMask( int mask );
216 StreamTarget& SetOption( int option );
225 StreamTarget& UnsetOption( int option );
234 static StreamTarget OpenStderr( const char *name );
243 static StreamTarget OpenStdout( const char *name );
244 };
245
246}
247
248#endif
A log entry.
Definition Entry.hpp:19
A target that will write log messages to a provided I/O stream.
Definition StreamTarget.hpp:18
~StreamTarget(void)
Closes the target and releases all memory owned by it.
StreamTarget & Log(int priority, const char *message,...)
Writes a log message with the given priority to this target.
int GetMask(void)
Gets the log mask of this target.
StreamTarget & SetDefaultMsgid(const char *msgid)
Sets the default message id for this target.
void Open(void)
Opens this target if it has been paused.
StreamTarget(struct stumpless_target *equivalent)
bool IsOpen(void)
Checks to see if this target is open.
StreamTarget(const char *name, FILE *stream)
Opens a stream target for the given stream.
StreamTarget & SetMask(int mask)
Sets the log mask of a target.
const char * GetDefaultMsgid(void)
Returns the default msgid used by this target.
StreamTarget & Log(const char *message,...)
Writes a string message to this target.
struct stumpless_target * equivalent
Definition StreamTarget.hpp:21
Facility GetDefaultFacility(void)
Gets the default facility of this target.
StreamTarget & Log(Facility facility, Severity severity, const char *message,...)
Writes a log message with the given facility and severity to this target.
const char * GetName(void)
Returns the name of this target.
StreamTarget & Log(Entry entry)
Writes an Entry to this target.
static StreamTarget OpenStdout(const char *name)
Opens a stream target to stdout.
StreamTarget & SetOption(int option)
Sets an option on a target.
stumpless_filter_func_t GetFilter(void)
Returns the current filter used by this target to determine if entries should be allowed through it.
StreamTarget & 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.
StreamTarget & UnsetOption(int option)
Unsets an option on a target.
int GetOption(int option)
Gets the given option for this target.
static StreamTarget OpenStderr(const char *name)
Opens a stream target to stderr.
StreamTarget & SetFilter(stumpless_filter_func_t filter)
Sets the filter used by this target to determine whether entries should be logged to it.
StreamTarget & SetDefaultFacility(int facility)
Sets the default facility of the 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