c++ - 如何使用 g3log 为每个函数或每个模块创建日志文件
问题描述
我需要使用 g3log 为每个函数或每个模块创建日志文件
但我不知道该怎么做......我阅读了包装并尝试去做,但我是一个非常新的程序员......
// main.cpp
#include<g2log.hpp>
#include<g2logworker.hpp>
#include <std2_make_unique.hpp>
#include "CustomSink.h"
int main(int argc, char**argv) {
using namespace g2;
auto defaultHandler = LogWorker::createWithDefaultLogger(argv[0],
path_to_log_file);
// logger is initialized
g2::initializeLogging(defaultHandler.worker.get());
...
}
任何人都可以写一个关于它的样本吗?
谢谢你!
解决方案
推荐阅读
- python - 包含相似功能的类之间的动态切换
- python - 将基于时间的字符串转换为数字
- ace-editor - 为什么 chrome 的灯塔审核不适用于 ace Texteditor
- javascript - 用函数合并两个选项对象
- arrays - 不重复的背包
- python - 如何在不使用 Python 中的 Numpy 的情况下从给定列表创建矩阵
- flutter - Flutter Firebase 只让某些数据显示在列表视图构建器上
- google-bigquery - 使用 bigquery 连接来自两个来源的数据
- node.js - React 可编辑 PDF 选项 (React-pdf/js-pdf)
- python - 反应应用程序中的 Monaco 编辑器与用于 python 智能感知的语言服务器