struct __timewin_conf sw_conf;
rollingfile_udata_t *sw_rfudata;
const char *sw_logdir;
const char *sw_files_prefix;
char *sw_curfileflag;
char *sw_prefileflag;
int sw_flags;
};
/***************************************************************************/
static int timewin_init(log4c_rollingpolicy_t *this, rollingfile_udata_t* rfup);
static int timewin_rollover(log4c_rollingpolicy_t *this, FILE **current_fpp );
static int timewin_is_triggering_event(
log4c_rollingpolicy_t *this,
const log4c_logging_event_t* a_event,
long current_file_size);
static int timewin_fini(log4c_rollingpolicy_t *this);
static char* timewin_get_filename(rollingpolicy_timewin_udata_t * swup);
static int timewin_check_update_fileflag(rollingpolicy_timewin_udata_t * swup);
static int timewin_open_file(char *filename, FILE **fpp );
static int timewin_copy_string(char** szDest, const char* src);
/*******************************************************************************
Policy intece: init, is_triggering_event, rollover
*******************************************************************************/
static int timewin_is_triggering_event(
log4c_rollingpolicy_t *this,
const log4c_logging_event_t* a_event,
long current_file_size){
int decision = 0;
rollingpolicy_timewin_udata_t *swup = log4c_rollingpolicy_get_udata(this);
sd_debug("timewin_is_triggering_event[");
decision = timewin_check_update_fileflag(swup);
if (decision)
{
sd_debug("triggering event");
}
else
{
sd_debug("not triggering event");
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-23402-6.html
因为还有中国和这样的国家能制衡美国