appender.h
Go to the documentation of this file.
/* $Id: appender.h,v 1.8 2013/04/06 13:04:53 valtri Exp $
*
* appender.h
*
* Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved.
*
* See the COPYING file for the terms of usage and distribution.
*/
#ifndef log4c_appender_h
#define log4c_appender_h
#include <log4c/defs.h>
#include <log4c/layout.h>
#include <stdio.h>
__LOG4C_BEGIN_DECLS
struct __log4c_appender;
typedef struct __log4c_appender log4c_appender_t;
typedef struct log4c_appender_type {
const char* name;
int (*open) (log4c_appender_t*);
int (*append) (log4c_appender_t*, const log4c_logging_event_t*);
int (*close) (log4c_appender_t*);
} log4c_appender_type_t;
LOG4C_API const log4c_appender_type_t* log4c_appender_type_get(const char* a_name);
LOG4C_API const log4c_appender_type_t* log4c_appender_type_set(
const log4c_appender_type_t* a_type);
LOG4C_API log4c_appender_t* log4c_appender_get(const char* a_name);
LOG4C_API log4c_appender_t* log4c_appender_new(const char* a_name);
LOG4C_API void log4c_appender_delete(log4c_appender_t* a_appender);
LOG4C_API const char* log4c_appender_get_name(const log4c_appender_t* a_appender);
LOG4C_API const log4c_appender_type_t* log4c_appender_get_type(
const log4c_appender_t* a_appender);
LOG4C_API const log4c_layout_t* log4c_appender_get_layout(
const log4c_appender_t* a_appender);
LOG4C_API void* log4c_appender_get_udata(const log4c_appender_t* a_appender);
LOG4C_API const log4c_appender_type_t* log4c_appender_set_type(
log4c_appender_t* a_appender,
const log4c_appender_type_t* a_type);
LOG4C_API void* log4c_appender_set_udata(log4c_appender_t* a_appender,
void* a_udata);
LOG4C_API const log4c_layout_t* log4c_appender_set_layout(
log4c_appender_t* a_appender,
const log4c_layout_t* a_layout);
LOG4C_API int log4c_appender_open(log4c_appender_t* a_appender);
LOG4C_API int log4c_appender_append(
log4c_appender_t* a_appender,
log4c_logging_event_t* a_event);
LOG4C_API int log4c_appender_close(log4c_appender_t* a_appender);
LOG4C_API void log4c_appender_print(const log4c_appender_t* a_appender,
FILE* a_stream);
LOG4C_API void log4c_appender_types_free(void);
LOG4C_API void log4c_appender_types_print(FILE *fp);
#ifdef __GNUC__
# define log4c_appender_type_define(a_type) \
typedef int log4c_appender_type_define_##a_type __attribute__((deprecated)); \
static log4c_appender_type_define_##a_type __unsused_var __attribute__ ((unused));
#else
# define log4c_appender_type_define(a_type)
#endif
struct __sd_factory;
LOG4C_API struct __sd_factory* log4c_appender_factory;
__LOG4C_END_DECLS
#endif
log4c_appender_print
void log4c_appender_print(const log4c_appender_t *a_appender, FILE *a_stream)
Definition: appender.c:304
log4c_appender_set_type
const log4c_appender_type_t * log4c_appender_set_type(log4c_appender_t *a_appender, const log4c_appender_type_t *a_type)
Definition: appender.c:183
log4c_appender_open
int log4c_appender_open(log4c_appender_t *a_appender)
Definition: appender.c:226
log4c_appender_type_get
const log4c_appender_type_t * log4c_appender_type_get(const char *a_name)
Definition: appender.c:68
log4c_appender_types_free
void log4c_appender_types_free(void)
Definition: appender.c:46
log4c_appender_set_layout
const log4c_layout_t * log4c_appender_set_layout(log4c_appender_t *a_appender, const log4c_layout_t *a_layout)
Definition: appender.c:198
log4c_appender_type
log4c appender type class
Definition: appender.h:46
log4c_appender_delete
void log4c_appender_delete(log4c_appender_t *a_appender)
Definition: appender.c:139
log4c_appender_type_set
const log4c_appender_type_t * log4c_appender_type_set(const log4c_appender_type_t *a_type)
Definition: appender.c:82
log4c_appender_types_print
void log4c_appender_types_print(FILE *fp)
Definition: appender.c:53
log4c_appender_append
int log4c_appender_append(log4c_appender_t *a_appender, log4c_logging_event_t *a_event)
Definition: appender.c:257
log4c_appender_get_layout
const log4c_layout_t * log4c_appender_get_layout(const log4c_appender_t *a_appender)
Definition: appender.c:171
log4c_appender_get_type
const log4c_appender_type_t * log4c_appender_get_type(const log4c_appender_t *a_appender)
Definition: appender.c:164
log4c_appender_type_t
struct log4c_appender_type log4c_appender_type_t
log4c appender type class
log4c_appender_new
log4c_appender_t * log4c_appender_new(const char *a_name)
Definition: appender.c:122
log4c_layout_t
struct __log4c_layout log4c_layout_t
Definition: layout.h:36
log4c_logging_event_t
logging event object
Definition: logging_event.h:49
log4c_appender_set_udata
void * log4c_appender_set_udata(log4c_appender_t *a_appender, void *a_udata)
Definition: appender.c:213
log4c_appender_get_name
const char * log4c_appender_get_name(const log4c_appender_t *a_appender)
Definition: appender.c:158
log4c_appender_get_udata
void * log4c_appender_get_udata(const log4c_appender_t *a_appender)
Definition: appender.c:177
log4c_appender_t
struct __log4c_appender log4c_appender_t
Definition: appender.h:34
layout.h
Interface for user specific layout format of log4c_logging_event events.
log4c_appender_get
log4c_appender_t * log4c_appender_get(const char *a_name)
Definition: appender.c:101
log4c_appender_close
int log4c_appender_close(log4c_appender_t *a_appender)
Definition: appender.c:282