conf.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * This file is part of the zlog Library.
  3. *
  4. * Copyright (C) 2011 by Hardy Simpson <HardySimpson1984@gmail.com>
  5. *
  6. * Licensed under the LGPL v2.1, see the file COPYING in base directory.
  7. */
  8. #ifndef __zlog_conf_h
  9. #define __zlog_conf_h
  10. #include "zc_defs.h"
  11. #include "format.h"
  12. #include "rotater.h"
  13. typedef struct zlog_conf_s {
  14. char file[MAXLEN_PATH + 1];
  15. char cfg_ptr[MAXLEN_CFG_LINE*MAXLINES_NO];
  16. char mtime[20 + 1];
  17. int strict_init;
  18. size_t buf_size_min;
  19. size_t buf_size_max;
  20. char rotate_lock_file[MAXLEN_CFG_LINE + 1];
  21. zlog_rotater_t *rotater;
  22. char default_format_line[MAXLEN_CFG_LINE + 1];
  23. zlog_format_t *default_format;
  24. unsigned int file_perms;
  25. size_t fsync_period;
  26. size_t reload_conf_period;
  27. zc_arraylist_t *levels;
  28. zc_arraylist_t *formats;
  29. zc_arraylist_t *rules;
  30. int time_cache_count;
  31. } zlog_conf_t;
  32. extern zlog_conf_t * zlog_env_conf;
  33. zlog_conf_t *zlog_conf_new(const char *config);
  34. void zlog_conf_del(zlog_conf_t * a_conf);
  35. void zlog_conf_profile(zlog_conf_t * a_conf, int flag);
  36. #endif