init.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* $Id$
  2. *
  3. * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved.
  4. *
  5. * See the COPYING file for the terms of usage and distribution.
  6. */
  7. #ifndef __log4c_init_h
  8. #define __log4c_init_h
  9. #include <log4c/defs.h>
  10. #include <stdio.h>
  11. __LOG4C_BEGIN_DECLS
  12. /**
  13. * @file init.h
  14. *
  15. * @brief log4c constructors and destructors
  16. *
  17. **/
  18. /**
  19. * constructor
  20. *
  21. * @returns 0 for success
  22. **/
  23. LOG4C_API int log4c_init(void);
  24. /**
  25. * another constructor
  26. *
  27. * 带有配置文件名的初始化函数
  28. * 完成功能和log4c_init完全一致,只是这里的配置文件名以参数形式传入的
  29. * @returns 0 for success .
  30. * 作者:jesse 日期:2008-9-6
  31. */
  32. LOG4C_API int log4c_init_with_cfg_file(const char *strCfgFileName);
  33. /**
  34. * destructor
  35. *
  36. * @returns 0 for success
  37. **/
  38. LOG4C_API int log4c_fini(void);
  39. /*
  40. * Dumps all the current appender, layout and rollingpolicy types
  41. * known by log4c.
  42. * @param stream to write to
  43. */
  44. LOG4C_API void log4c_dump_all_types(FILE *fp);
  45. /*
  46. * Dumps all the current instances of categories, appenders, layouts
  47. * and rollingpolicy objects.
  48. * An instances of a type consists of the base
  49. * type information (name plus function table) and an instance name and
  50. * configuration. For example one can have an instance of the rollingfile
  51. * appender which logs to /var/tmp and another instance which logs to
  52. * /usr/tmp. They are both of type rollingfile, but are distinct instances of
  53. * it
  54. * @param stream to write t
  55. */
  56. LOG4C_API void log4c_dump_all_instances(FILE *fp);
  57. __LOG4C_END_DECLS
  58. #endif