log4.h 909 B

1234567891011121314151617181920212223242526
  1. #pragma once
  2. #include "define.h"
  3. namespace ylib
  4. {
  5. /*
  6. * @class:Log4cplus 日志封装类
  7. * @desc:
  8. * 1、程序默认开启,如需更改请修改 public/environment.cpp 中的全局变量实现(注释new即可)
  9. * 2、默认配置文件放置程序目录 res/log.properties, 示例文件参考:res/log.properties
  10. */
  11. class log4
  12. {
  13. public:
  14. log4(const std::string& config_filepath);
  15. ~log4();
  16. ylib::log4& info(const std::string& value,const std::string& name = "ALL");
  17. ylib::log4& error(const std::string& value,const std::string& name = "ALL");
  18. ylib::log4& fatal(const std::string& value,const std::string& name = "ALL");
  19. ylib::log4& warn(const std::string& value,const std::string& name = "ALL");
  20. ylib::log4& debug(const std::string& value,const std::string& name = "ALL");
  21. private:
  22. void* m_appender;
  23. void* m_appender_console;
  24. };
  25. }