rollingpolicy.h
Go to the documentation of this file.
/*
* rollingpolicy.h
*
* See the COPYING file for the terms of usage and distribution.
*/
#ifndef log4c_rollingpolicy_h
#define log4c_rollingpolicy_h
#include <stdio.h>
#include <log4c/defs.h>
#include <log4c/layout.h>
__LOG4C_BEGIN_DECLS
struct __log4c_rollingpolicy;
typedef struct __log4c_rollingpolicy log4c_rollingpolicy_t;
#define ROLLINGFILE_DEFAULT_LOG_DIR "."
#define ROLLINGFILE_DEFAULT_LOG_PREFIX "log"
typedef struct __rollingfile_udata rollingfile_udata_t; /* opaque */
typedef struct log4c_rollingpolicy_type {
const char* name;
int (*init)(log4c_rollingpolicy_t *a_this, rollingfile_udata_t* rfudatap );
int (*is_triggering_event)( log4c_rollingpolicy_t* a_policy,
const log4c_logging_event_t*,
long current_file_size );
int (*rollover)(log4c_rollingpolicy_t* a_policy, FILE **);
int (*fini)(log4c_rollingpolicy_t *a_this);
} log4c_rollingpolicy_type_t;
LOG4C_API log4c_rollingpolicy_t* log4c_rollingpolicy_get(
const char* policy_name);
LOG4C_API const log4c_rollingpolicy_type_t* log4c_rollingpolicy_type_set(
const log4c_rollingpolicy_type_t* a_type);
LOG4C_API void log4c_rollingpolicy_set_udata(log4c_rollingpolicy_t* policyp,
void *udatap);
LOG4C_API int log4c_rollingpolicy_init(log4c_rollingpolicy_t *policyp,
rollingfile_udata_t* rfup );
LOG4C_API int log4c_rollingpolicy_fini(log4c_rollingpolicy_t *policyp);
LOG4C_API int log4c_rollingpolicy_is_triggering_event(
log4c_rollingpolicy_t* policyp,
const log4c_logging_event_t* evtp,
long current_file_size );
#define ROLLINGPOLICY_ROLLOVER_ERR_CAN_LOG 0x05
LOG4C_API int log4c_rollingpolicy_rollover(log4c_rollingpolicy_t* policyp,
FILE ** fp);
LOG4C_API const log4c_rollingpolicy_type_t* log4c_rollingpolicy_set_type(
log4c_rollingpolicy_t* a_rollingpolicy,
const log4c_rollingpolicy_type_t* a_type);
LOG4C_API const log4c_rollingpolicy_type_t* log4c_rollingpolicy_type_get(
const char* a_name);
LOG4C_API void* log4c_rollingpolicy_get_udata(
const log4c_rollingpolicy_t* policyp);
LOG4C_API rollingfile_udata_t* log4c_rollingpolicy_get_rfudata(
const log4c_rollingpolicy_t* policyp);
LOG4C_API void* log4c_rollingpolicy_get_name(const log4c_rollingpolicy_t* a_this);
LOG4C_API log4c_rollingpolicy_t* log4c_rollingpolicy_new(const char* a_name);
LOG4C_API void log4c_rollingpolicy_delete(log4c_rollingpolicy_t* a_this);
LOG4C_API void log4c_rollingpolicy_print(const log4c_rollingpolicy_t* a_this,
FILE* a_stream);
LOG4C_API int log4c_rollingpolicy_is_initialized(log4c_rollingpolicy_t* a_this);
LOG4C_API void log4c_rollingpolicy_types_free(void);
LOG4C_API void log4c_rollingpolicy_types_print(FILE *fp);
struct __sd_factory;
LOG4C_API struct __sd_factory* log4c_rollingpolicy_factory;
__LOG4C_END_DECLS
#endif
log4c_rollingpolicy_t
struct __log4c_rollingpolicy log4c_rollingpolicy_t
Definition: rollingpolicy.h:32
log4c_rollingpolicy_fini
int log4c_rollingpolicy_fini(log4c_rollingpolicy_t *policyp)
Definition: rollingpolicy.c:159
log4c_rollingpolicy_is_triggering_event
int log4c_rollingpolicy_is_triggering_event(log4c_rollingpolicy_t *policyp, const log4c_logging_event_t *evtp, long current_file_size)
Definition: rollingpolicy.c:188
log4c_rollingpolicy_set_type
const log4c_rollingpolicy_type_t * log4c_rollingpolicy_set_type(log4c_rollingpolicy_t *a_rollingpolicy, const log4c_rollingpolicy_type_t *a_type)
Definition: rollingpolicy.c:270
log4c_rollingpolicy_get
log4c_rollingpolicy_t * log4c_rollingpolicy_get(const char *policy_name)
Definition: rollingpolicy.c:66
log4c_logging_event_t
logging event object
Definition: logging_event.h:49
log4c_rollingpolicy_type_t
struct log4c_rollingpolicy_type log4c_rollingpolicy_type_t
log4c rollingpolicy type. Defines the interface a specific policy must provide to the rollingfile app...
log4c_rollingpolicy_type_get
const log4c_rollingpolicy_type_t * log4c_rollingpolicy_type_get(const char *a_name)
Definition: rollingpolicy.c:250
layout.h
Interface for user specific layout format of log4c_logging_event events.
log4c_rollingpolicy_type_set
const log4c_rollingpolicy_type_t * log4c_rollingpolicy_type_set(const log4c_rollingpolicy_type_t *a_type)
Definition: rollingpolicy.c:233
log4c_rollingpolicy_type
log4c rollingpolicy type. Defines the interface a specific policy must provide to the rollingfile app...
Definition: rollingpolicy.h:53
log4c_rollingpolicy_get_udata
void * log4c_rollingpolicy_get_udata(const log4c_rollingpolicy_t *policyp)
Definition: rollingpolicy.c:217
log4c_rollingpolicy_set_udata
void log4c_rollingpolicy_set_udata(log4c_rollingpolicy_t *policyp, void *udatap)
Definition: rollingpolicy.c:263
log4c_rollingpolicy_init
int log4c_rollingpolicy_init(log4c_rollingpolicy_t *policyp, rollingfile_udata_t *rfup)
Definition: rollingpolicy.c:136
log4c_rollingpolicy_get_rfudata
rollingfile_udata_t * log4c_rollingpolicy_get_rfudata(const log4c_rollingpolicy_t *policyp)
Definition: rollingpolicy.c:227