当前位置: 首页 > 工具软件 > Fix8 > 使用案例 >

fix8源码分析之日志模块

宣原
2023-12-01

    本分析基于fix8 1.3.4版本源代码;

fix8中全局日志的使用方式如下:

GlobalLogger::set_global_filename(log); //设置日志输出文件
    FIX8::Logger::Levels levels;
    levels.clearall();
    string glevels = fixnode.get<string>("<xmlattr>.glevels", "");
    if (glevels.find("debug") != string::npos)
        levels << FIX8::Logger::Level::Debug;
    if (glevels.find("info") != string::npos)
        levels << FIX8::Logger::Level::Info;
    if (glevels.find("warn") != string::npos)
        levels << FIX8::Logger::Level::Warn;
    if (glevels.find("error") != string::npos)
        levels << FIX8::Logger::Level::Error;
    if (glevels.find("fatal") != string::npos)
        levels << FIX8::Logger::Level::Fatal;
    GlobalLogger::set_levels(levels);//记录错误日志

 

 

 

 

 

 

 

 

转载于:https://www.cnblogs.com/skiing886/p/7976975.html

 类似资料: