c++ - boost 记录器,多个日志文件和记录器

标签 c++ logging boost

我正在尝试在我的应用程序中使用 boost 日志库,但我遇到了问题。

如何配置 boost log 以拥有 3 个记录到不同文件的记录器。 示例:

  • main_logger(main.log)
  • gui_loger(gui.log)
  • some_other_logger(other.log)

我还想在不同级别(信息、警告、调试、错误)上使用日志记录。

示例:

BOOST_LOG_SEV(main_logger, logging::trivial::debug)

如何配置?

最佳答案

您可以使用多文件后端:Boost.Log multi-file backend .

关于c++ - boost 记录器,多个日志文件和记录器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18186796/

相关文章:

c++ - QT问题中声明StringStream

c++ - QtCreator 4 和 CMake 参数

linux - 用于将所有应用程序崩溃事件写入文本文件的 Bash 脚本

.net - 使用 log4net 发送日志文件的最佳方法

c++ - 无法使用 Boost GIL 检测图像文件类型(未捕获异常)

c++ - MS dos 和 Dev C++ 编译器中的预增量和后增量结果差异

c++ - 视觉辅助添加包含指令

python - 使用 PyInstaller 自定义日志处理程序和格式化程序

c++ - 'reinterpret_cast' : cannot convert from 'overloaded-function' to 'intptr_t' with boost. dll

boost - 无法使用 STLport 库构建 Boost