init.h 1.4 KB

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