appender.h(3) | log4c | appender.h(3) |
NAME¶
appender.h - Implement this interface for your own strategies for printing log statements.
SYNOPSIS¶
#include <log4c/defs.h>
#include <log4c/layout.h>
#include <stdio.h>
Data Structures¶
struct log4c_appender_type
log4c appender type class
Macros¶
#define log4c_appender_type_define(a_type)
Typedefs¶
typedef struct __log4c_appender log4c_appender_t
typedef struct log4c_appender_type log4c_appender_type_t
log4c appender type class
Functions¶
const log4c_appender_type_t *
log4c_appender_type_get (const char *a_name)
const log4c_appender_type_t * log4c_appender_type_set (const
log4c_appender_type_t *a_type)
log4c_appender_t * log4c_appender_get (const char *a_name)
log4c_appender_t * log4c_appender_new (const char *a_name)
void log4c_appender_delete (log4c_appender_t *a_appender)
const char * log4c_appender_get_name (const log4c_appender_t
*a_appender)
const log4c_appender_type_t * log4c_appender_get_type (const
log4c_appender_t *a_appender)
const log4c_layout_t * log4c_appender_get_layout (const
log4c_appender_t *a_appender)
void * log4c_appender_get_udata (const log4c_appender_t
*a_appender)
const log4c_appender_type_t * log4c_appender_set_type
(log4c_appender_t *a_appender, const log4c_appender_type_t
*a_type)
void * log4c_appender_set_udata (log4c_appender_t *a_appender,
void *a_udata)
const log4c_layout_t * log4c_appender_set_layout
(log4c_appender_t *a_appender, const log4c_layout_t *a_layout)
int log4c_appender_open (log4c_appender_t *a_appender)
int log4c_appender_append (log4c_appender_t *a_appender,
log4c_logging_event_t *a_event)
int log4c_appender_close (log4c_appender_t *a_appender)
void log4c_appender_print (const log4c_appender_t *a_appender,
FILE *a_stream)
void log4c_appender_types_free (void)
void log4c_appender_types_print (FILE *fp)
Detailed Description¶
Implement this interface for your own strategies for printing log statements.
Todo
Macro Definition Documentation¶
#define log4c_appender_type_define(a_type)¶
Helper macro to define static appender types.
Parameters
Warning
Deprecated
Typedef Documentation¶
typedef struct __log4c_appender log4c_appender_t¶
log4c appender class
typedef struct log4c_appender_type log4c_appender_type_t¶
log4c appender type class Attributes description:
- name appender type name
- open
- append
- close
Function Documentation¶
int log4c_appender_append (log4c_appender_t * this, log4c_logging_event_t * a_event)¶
log in appender specific way.
Parameters
a_event the log4c_logging_event_t object to log.
Bug
References log4c_appender_open(), and log4c_layout_format().
int log4c_appender_close (log4c_appender_t * a_appender)¶
closes the appender
Parameters
Returns
void log4c_appender_delete (log4c_appender_t * a_appender)¶
Destructor for log4c_appender_t.
References log4c_appender_close().
log4c_appender_t * log4c_appender_get (const char * a_name)¶
Get a pointer to an existing appender.
Parameters
Returns
References log4c_appender_delete(), log4c_appender_new(), and log4c_appender_print().
const log4c_layout_t * log4c_appender_get_layout (const log4c_appender_t * a_appender)¶
Parameters
Returns
const char * log4c_appender_get_name (const log4c_appender_t * a_appender)¶
Parameters
Returns
const log4c_appender_type_t * log4c_appender_get_type (const log4c_appender_t * a_appender)¶
Parameters
Returns
void * log4c_appender_get_udata (const log4c_appender_t * a_appender)¶
Parameters
Returns
log4c_appender_t * log4c_appender_new (const char * a_name)¶
Constructor for log4c_appender_t.
References log4c_appender_type_stream, and log4c_layout_get().
int log4c_appender_open (log4c_appender_t * a_appender)¶
opens the appender.
Parameters
void log4c_appender_print (const log4c_appender_t * a_appender, FILE * a_stream)¶
prints the appender on a stream
Parameters
a_stream the stream
References log4c_layout_get_name().
const log4c_layout_t * log4c_appender_set_layout (log4c_appender_t * a_appender, const log4c_layout_t * a_layout)¶
sets the appender layout
Parameters
a_layout the new appender layout
Returns
const log4c_appender_type_t * log4c_appender_set_type (log4c_appender_t * a_appender, const log4c_appender_type_t * a_type)¶
sets the appender type
Parameters
a_type the new appender type
Returns
void * log4c_appender_set_udata (log4c_appender_t * a_appender, void * a_udata)¶
sets the appender user data
Parameters
a_udata the new appender user data
Returns
const log4c_appender_type_t * log4c_appender_type_get (const char * a_name)¶
Get a pointer to an existing appender type.
Parameters
Returns
const log4c_appender_type_t * log4c_appender_type_set (const log4c_appender_type_t * 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.
Parameters
Returns
Example code fragment:
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);
void log4c_appender_types_free (void)¶
free all appender types
void log4c_appender_types_print (FILE * fp)¶
prints all the current registered appender types on a stream
Parameters
Author¶
Generated automatically by Doxygen for log4c from the source code.
Thu Jan 19 2023 | Version 1.2.4 |