conf.h 985 Bytes
Newer Older
Hardy Simpson's avatar
Hardy Simpson committed
1
/*
Hardy Simpson's avatar
Hardy Simpson committed
2
 * This file is part of the zlog Library.
Hardy Simpson's avatar
Hardy Simpson committed
3
 *
Hardy Simpson's avatar
Hardy Simpson committed
4
 * Copyright (C) 2011 by Hardy Simpson <HardySimpson1984@gmail.com>
Hardy Simpson's avatar
Hardy Simpson committed
5
 *
6
 * Licensed under the LGPL v2.1, see the file COPYING in base directory.
Hardy Simpson's avatar
Hardy Simpson committed
7 8
 */

Hardy Simpson's avatar
Hardy Simpson committed
9
#ifndef __zlog_conf_h
10
#define __zlog_conf_h
Hardy Simpson's avatar
Hardy Simpson committed
11 12

#include "zc_defs.h"
13
#include "format.h"
14
#include "rotater.h"
Hardy Simpson's avatar
Hardy Simpson committed
15

16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
typedef struct zlog_conf_s {
	char file[MAXLEN_PATH + 1];
	char mtime[20 + 1];

	int strict_init;
	size_t buf_size_min;
	size_t buf_size_max;

	char rotate_lock_file[MAXLEN_CFG_LINE + 1];
	zlog_rotater_t *rotater;

	char default_format_line[MAXLEN_CFG_LINE + 1];
	zlog_format_t *default_format;

	unsigned int file_perms;
	size_t fsync_period;
	size_t reload_conf_period;

	zc_arraylist_t *levels;
	zc_arraylist_t *formats;
	zc_arraylist_t *rules;
37
	int time_cache_count;
38
} zlog_conf_t;
Hardy Simpson's avatar
Hardy Simpson committed
39

40 41
extern zlog_conf_t * zlog_env_conf;

Hardy Simpson's avatar
Hardy Simpson committed
42
zlog_conf_t *zlog_conf_new(const char *confpath);
43 44
void zlog_conf_del(zlog_conf_t * a_conf);
void zlog_conf_profile(zlog_conf_t * a_conf, int flag);
Hardy Simpson's avatar
Hardy Simpson committed
45 46

#endif