![]() |
C++客户端开发接口库 V5.1.8.15
连接信创集成中间件服务程序的二次开发接口
|
#include <MDWLogger.h>
Public 成员函数 | |
| CMDWLogger (const std::string &sProductName, const std::string &sWorkDirectory="", int iLogFileRetentionDays=100) | |
| ~CMDWLogger () | |
| void | SetWriteDebugLog (bool bWrite) |
| void | SetDebugLogFuntion (const std::string &sFunConfig) |
| bool | NeedWriteDebugLog (int iFunNo) |
| void | CloseLogFile () |
| void | OpenLogFile () |
| void | ClearLogFile () |
| void | StartProcLog () |
| void | StopProcLog () |
| void | Push (LOGLEVEL Level, const std::string &sFunctionName, const std::list< std::string > &lstMsg) |
| void | Push (LOGLEVEL Level, const std::string &sFunctionName, const std::string &sLogMsg) |
| void | Push (LOGLEVEL Level, const std::string &sFunctionName, const char *fmt,...) |
| void | PushError (const std::string &sFunctionName, const std::string &sLogMsg) |
| void | PushError (const std::string &sFunctionName, const char *fmt,...) |
| void | PushWaring (const std::string &sFunctionName, const std::string &sLogMsg) |
| void | PushWaring (const std::string &sFunctionName, const char *fmt,...) |
| void | Push (const std::string &sFunctionName, const std::exception &ex) |
| bool | Pop (MDWLogMsg &logmsg) |
| bool | WriteFinshed () |
中间件通信库内部日志记录类,生成单独的日志文件,只用于内部运行逻辑分析
| mdwc::CMDWLogger::CMDWLogger | ( | const std::string & | sProductName, |
| const std::string & | sWorkDirectory = "", | ||
| int | iLogFileRetentionDays = 100 ) |
构造函数.
| sProductName | 产品名称,用于生成不同的日志文件 |
| sWorkDirectory | 用于创建日志工作文件夹 |
| iLogFileRetentionDays | 日志文件保留天数 |

| mdwc::CMDWLogger::~CMDWLogger | ( | ) |

| void mdwc::CMDWLogger::ClearLogFile | ( | ) |
清除当前日志文件
| void mdwc::CMDWLogger::CloseLogFile | ( | ) |
关闭所有的日志文件

| bool mdwc::CMDWLogger::NeedWriteDebugLog | ( | int | iFunNo | ) |
当前功能是否需要写调试日志.
| iFunNo | 功能号 |
| void mdwc::CMDWLogger::OpenLogFile | ( | ) |
用记事本打开当前日志文件
| bool mdwc::CMDWLogger::Pop | ( | MDWLogMsg & | logmsg | ) |
从队列中取出最早的日志消息.
| logmsg | 用于存储取出的日志消息 |
| void mdwc::CMDWLogger::Push | ( | const std::string & | sFunctionName, |
| const std::exception & | ex ) |
添加异常信息到日志队列.
| sFunctionName | 执行函数名称 |
| ex | 异常对象 |
| void mdwc::CMDWLogger::Push | ( | LOGLEVEL | Level, |
| const std::string & | sFunctionName, | ||
| const char * | fmt, | ||
| ... ) |
添加单条日志消息到队列.
| Level | 日志级别 |
| sFunctionName | 执行函数名称 |
| fmt | 字符串格式化内容 |

| void mdwc::CMDWLogger::Push | ( | LOGLEVEL | Level, |
| const std::string & | sFunctionName, | ||
| const std::list< std::string > & | lstMsg ) |
添加日志消息到队列.
| Level | 日志级别 |
| sFunctionName | 执行函数名称 |
| lstMsg | 日志消息列表 |


| void mdwc::CMDWLogger::Push | ( | LOGLEVEL | Level, |
| const std::string & | sFunctionName, | ||
| const std::string & | sLogMsg ) |
添加单条日志消息到队列.
| Level | 日志级别 |
| sFunctionName | 执行函数名称 |
| sLogMsg | 日志内容 |
| void mdwc::CMDWLogger::PushError | ( | const std::string & | sFunctionName, |
| const char * | fmt, | ||
| ... ) |
添加错误信息到日志队列.
| sFunctionName | 执行函数名称 |
| fmt | 字符串格式化内容 |

| void mdwc::CMDWLogger::PushError | ( | const std::string & | sFunctionName, |
| const std::string & | sLogMsg ) |
添加错误信息到日志队列.
| sFunctionName | 执行函数名称 |
| sLogMsg | 日志内容 |

| void mdwc::CMDWLogger::PushWaring | ( | const std::string & | sFunctionName, |
| const char * | fmt, | ||
| ... ) |
添加警告信息到日志队列
| sFunctionName | 执行函数名称 |
| fmt | 字符串格式化内容 |

| void mdwc::CMDWLogger::PushWaring | ( | const std::string & | sFunctionName, |
| const std::string & | sLogMsg ) |
添加警告信息到日志队列
| sFunctionName | 执行函数名称 |
| sLogMsg | 日志内容 |

| void mdwc::CMDWLogger::SetDebugLogFuntion | ( | const std::string & | sFunConfig | ) |
设置需要写数据日志的功能与列表.
| sFunConfig | 功能配置,格式:[功能编号1,功能编号2,...] |

|
inline |
设置保存调试日志
| void mdwc::CMDWLogger::StartProcLog | ( | ) |
启动日志保存线程
| void mdwc::CMDWLogger::StopProcLog | ( | ) |
停止日志保存线程


| bool mdwc::CMDWLogger::WriteFinshed | ( | ) |
检查所有日志是否已写入文件完成.
