.TH "appender.h" 3 "Version 1.2.4" "log4c" \" -*- nroff -*- .ad l .nh .SH NAME appender.h \- Implement this interface for your own strategies for printing log statements\&. .SH SYNOPSIS .br .PP \fC#include \fP .br \fC#include \fP .br \fC#include \fP .br .SS "Data Structures" .in +1c .ti -1c .RI "struct \fBlog4c_appender_type\fP" .br .RI "log4c appender type class " .in -1c .SS "Macros" .in +1c .ti -1c .RI "#define \fBlog4c_appender_type_define\fP(a_type)" .br .in -1c .SS "Typedefs" .in +1c .ti -1c .RI "typedef struct __log4c_appender \fBlog4c_appender_t\fP" .br .ti -1c .RI "typedef struct \fBlog4c_appender_type\fP \fBlog4c_appender_type_t\fP" .br .RI "log4c appender type class " .in -1c .SS "Functions" .in +1c .ti -1c .RI "const \fBlog4c_appender_type_t\fP * \fBlog4c_appender_type_get\fP (const char *a_name)" .br .ti -1c .RI "const \fBlog4c_appender_type_t\fP * \fBlog4c_appender_type_set\fP (const \fBlog4c_appender_type_t\fP *a_type)" .br .ti -1c .RI "\fBlog4c_appender_t\fP * \fBlog4c_appender_get\fP (const char *a_name)" .br .ti -1c .RI "\fBlog4c_appender_t\fP * \fBlog4c_appender_new\fP (const char *a_name)" .br .ti -1c .RI "void \fBlog4c_appender_delete\fP (\fBlog4c_appender_t\fP *a_appender)" .br .ti -1c .RI "const char * \fBlog4c_appender_get_name\fP (const \fBlog4c_appender_t\fP *a_appender)" .br .ti -1c .RI "const \fBlog4c_appender_type_t\fP * \fBlog4c_appender_get_type\fP (const \fBlog4c_appender_t\fP *a_appender)" .br .ti -1c .RI "const \fBlog4c_layout_t\fP * \fBlog4c_appender_get_layout\fP (const \fBlog4c_appender_t\fP *a_appender)" .br .ti -1c .RI "void * \fBlog4c_appender_get_udata\fP (const \fBlog4c_appender_t\fP *a_appender)" .br .ti -1c .RI "const \fBlog4c_appender_type_t\fP * \fBlog4c_appender_set_type\fP (\fBlog4c_appender_t\fP *a_appender, const \fBlog4c_appender_type_t\fP *a_type)" .br .ti -1c .RI "void * \fBlog4c_appender_set_udata\fP (\fBlog4c_appender_t\fP *a_appender, void *a_udata)" .br .ti -1c .RI "const \fBlog4c_layout_t\fP * \fBlog4c_appender_set_layout\fP (\fBlog4c_appender_t\fP *a_appender, const \fBlog4c_layout_t\fP *a_layout)" .br .ti -1c .RI "int \fBlog4c_appender_open\fP (\fBlog4c_appender_t\fP *a_appender)" .br .ti -1c .RI "int \fBlog4c_appender_append\fP (\fBlog4c_appender_t\fP *a_appender, \fBlog4c_logging_event_t\fP *a_event)" .br .ti -1c .RI "int \fBlog4c_appender_close\fP (\fBlog4c_appender_t\fP *a_appender)" .br .ti -1c .RI "void \fBlog4c_appender_print\fP (const \fBlog4c_appender_t\fP *a_appender, FILE *a_stream)" .br .ti -1c .RI "void \fBlog4c_appender_types_free\fP (void)" .br .ti -1c .RI "void \fBlog4c_appender_types_print\fP (FILE *fp)" .br .in -1c .SH "Detailed Description" .PP Implement this interface for your own strategies for printing log statements\&. .PP \fBTodo\fP .RS 4 the appender interface needs a better configuration system depending on the layout type\&. The udata field is a just a trick\&. .RE .PP .SH "Macro Definition Documentation" .PP .SS "#define log4c_appender_type_define(a_type)" Helper macro to define static appender types\&. .PP \fBParameters\fP .RS 4 \fIa_type\fP the log4c_appender_type_t object to define .RE .PP \fBWarning\fP .RS 4 needs GCC support: otherwise this macro does nothing .RE .PP \fBDeprecated\fP .RS 4 This macro, and the static initialialization of appenders in general, is deprecated\&. Use rather the \fBlog4c_appender_type_set()\fP function to initialize your appenders before calling log4c_init() .RE .PP .SH "Typedef Documentation" .PP .SS "typedef struct __log4c_appender \fBlog4c_appender_t\fP" log4c appender class .SS "typedef struct \fBlog4c_appender_type\fP \fBlog4c_appender_type_t\fP" .PP log4c appender type class Attributes description: .PP .PD 0 .IP "\(bu" 1 \fCname\fP appender type name .IP "\(bu" 1 \fCopen\fP .IP "\(bu" 1 \fCappend\fP .IP "\(bu" 1 \fCclose\fP .PP .SH "Function Documentation" .PP .SS "int log4c_appender_append (\fBlog4c_appender_t\fP * this, \fBlog4c_logging_event_t\fP * a_event)" log in appender specific way\&. .PP \fBParameters\fP .RS 4 \fIa_appender\fP the log4c_appender object .br \fIa_event\fP the \fBlog4c_logging_event_t\fP object to log\&. .RE .PP \fBBug\fP .RS 4 is this the right place to open an appender ? .RE .PP .SS "int log4c_appender_close (\fBlog4c_appender_t\fP * a_appender)" closes the appender .PP \fBParameters\fP .RS 4 \fIa_appender\fP the log4c_appender_t object .RE .PP \fBReturns\fP .RS 4 zero if successful, -1 otherwise .RE .PP .SS "void log4c_appender_delete (\fBlog4c_appender_t\fP * a_appender)" Destructor for log4c_appender_t\&. .SS "\fBlog4c_appender_t\fP * log4c_appender_get (const char * a_name)" Get a pointer to an existing appender\&. .PP \fBParameters\fP .RS 4 \fIa_name\fP the name of the appender to return\&. .RE .PP \fBReturns\fP .RS 4 a pointer to an existing appender, or NULL if no appender with the specfied name exists\&. .RE .PP .SS "const \fBlog4c_layout_t\fP * log4c_appender_get_layout (const \fBlog4c_appender_t\fP * a_appender)" .PP \fBParameters\fP .RS 4 \fIa_appender\fP the log4c_appender_t object .RE .PP \fBReturns\fP .RS 4 the appender layout .RE .PP .SS "const char * log4c_appender_get_name (const \fBlog4c_appender_t\fP * a_appender)" .PP \fBParameters\fP .RS 4 \fIa_appender\fP the log4c_appender_t object .RE .PP \fBReturns\fP .RS 4 the appender name .RE .PP .SS "const \fBlog4c_appender_type_t\fP * log4c_appender_get_type (const \fBlog4c_appender_t\fP * a_appender)" .PP \fBParameters\fP .RS 4 \fIa_appender\fP the log4c_appender_t object .RE .PP \fBReturns\fP .RS 4 the appender operations .RE .PP .SS "void * log4c_appender_get_udata (const \fBlog4c_appender_t\fP * a_appender)" .PP \fBParameters\fP .RS 4 \fIa_appender\fP the log4c_appender_t object .RE .PP \fBReturns\fP .RS 4 the appender user data .RE .PP .SS "\fBlog4c_appender_t\fP * log4c_appender_new (const char * a_name)" Constructor for log4c_appender_t\&. .SS "int log4c_appender_open (\fBlog4c_appender_t\fP * a_appender)" opens the appender\&. .PP \fBParameters\fP .RS 4 \fIa_appender\fP the log4c_appender_t object .RE .PP .SS "void log4c_appender_print (const \fBlog4c_appender_t\fP * a_appender, FILE * a_stream)" prints the appender on a stream .PP \fBParameters\fP .RS 4 \fIa_appender\fP the log4c_appender_t object .br \fIa_stream\fP the stream .RE .PP .SS "const \fBlog4c_layout_t\fP * log4c_appender_set_layout (\fBlog4c_appender_t\fP * a_appender, const \fBlog4c_layout_t\fP * a_layout)" sets the appender layout .PP \fBParameters\fP .RS 4 \fIa_appender\fP the log4c_appender_t object .br \fIa_layout\fP the new appender layout .RE .PP \fBReturns\fP .RS 4 the previous appender layout .RE .PP .SS "const \fBlog4c_appender_type_t\fP * log4c_appender_set_type (\fBlog4c_appender_t\fP * a_appender, const \fBlog4c_appender_type_t\fP * a_type)" sets the appender type .PP \fBParameters\fP .RS 4 \fIa_appender\fP the log4c_appender_t object .br \fIa_type\fP the new appender type .RE .PP \fBReturns\fP .RS 4 the previous appender type .RE .PP .SS "void * log4c_appender_set_udata (\fBlog4c_appender_t\fP * a_appender, void * a_udata)" sets the appender user data .PP \fBParameters\fP .RS 4 \fIa_appender\fP the log4c_appender_t object .br \fIa_udata\fP the new appender user data .RE .PP \fBReturns\fP .RS 4 the previous appender user data .RE .PP .SS "const \fBlog4c_appender_type_t\fP * log4c_appender_type_get (const char * a_name)" Get a pointer to an existing appender type\&. .PP \fBParameters\fP .RS 4 \fIa_name\fP the name of the appender type to return\&. .br .RE .PP \fBReturns\fP .RS 4 a pointer to an existing appender type, or NULL if no appender type with the specified name exists\&. .RE .PP .SS "const \fBlog4c_appender_type_t\fP * log4c_appender_type_set (const \fBlog4c_appender_type_t\fP * a_type)" Use this function to register an appender type with log4c\&. Once this is done you may refer to this type by name both programmatically and in the log4c configuration file\&. .PP \fBParameters\fP .RS 4 \fIa_type\fP a pointer to the new appender type to set\&. .RE .PP \fBReturns\fP .RS 4 a pointer to the previous appender type of same name\&. .RE .PP Example code fragment: .PP .nf const log4c_appender_type_t log4c_appender_type_s13_file = { "s13_file", s13_file_open, s13_file_append, s13_file_close, }; log4c_appender_type_set(&log4c_appender_type_s13_file); .fi .PP .SS "void log4c_appender_types_free (void)" free all appender types .SS "void log4c_appender_types_print (FILE * fp)" prints all the current registered appender types on a stream .PP \fBParameters\fP .RS 4 \fIfp\fP the stream .RE .PP .SH "Author" .PP Generated automatically by Doxygen for log4c from the source code\&.