C++客户端开发接口库 V5.1.8.15
连接信创集成中间件服务程序的二次开发接口
载入中...
搜索中...
未找到
CAppLogger类 参考

#include <AppLogger.h>

Public 成员函数

void TruncateLogFile ()
void EnabledDebugLog (bool bEnabled)
bool IsEnabledDebugLog () const
void WriteLog (const std::string &sFunctionName, const std::string &sLogMsg)
void WriteLog (const std::string &sFunctionName, const char *fmt,...)
void WriteDebug (const std::string &sFunctionName, const std::string &sLogMsg)
void WriteDebug (const std::string &sFunctionName, const char *fmt,...)
void WriteDebugCompile (const std::string &sFunctionName, const char *fmt,...)
void WriteErrorLog (const std::string &sFunctionName, const std::string &sLogMsg)
void WriteErrorLog (const std::string &sFunctionName, const char *fmt,...)
void WriteWaringLog (const std::string &sFunctionName, const std::string &sLogMsg)
void WriteWaringLog (const std::string &sFunctionName, const char *fmt,...)
void WriteExceptionLog (const std::string &sFunctionName, const std::exception &ex)
std::string GetLastLogMessage ()
void StartAppLogger ()
void StopAppLogger ()
void OpenLogFile ()
void ClearLogFile ()
 CAppLogger (const std::string &sAppIdentity, const std::string &sWorkDirectory="", int iLogFileRetentionDays=100)
 ~CAppLogger ()

详细描述

显示和保存应用程序运行日志,要手工实例化或释放.

构造及析构函数说明

◆ CAppLogger()

CAppLogger::CAppLogger ( const std::string & sAppIdentity,
const std::string & sWorkDirectory = "",
int iLogFileRetentionDays = 100 )

构造函数

参数
sAppIdentity应用程序标识
sWorkDirectory工作文件夹用于创建日志
iLogFileRetentionDays日志文件保留天数
函数调用图:

◆ ~CAppLogger()

CAppLogger::~CAppLogger ( )

释放资源关闭文件

函数调用图:

成员函数说明

◆ ClearLogFile()

void CAppLogger::ClearLogFile ( )

清除当前日志文件,如果还有日志信息会自动重新创建文件

◆ EnabledDebugLog()

void CAppLogger::EnabledDebugLog ( bool bEnabled)
inline

设置写入调试日志标志

◆ GetLastLogMessage()

std::string CAppLogger::GetLastLogMessage ( )
inline

◆ IsEnabledDebugLog()

bool CAppLogger::IsEnabledDebugLog ( ) const
inline

获取写入调试日志标志

◆ OpenLogFile()

void CAppLogger::OpenLogFile ( )

用记事本打开当前日志文件

◆ StartAppLogger()

void CAppLogger::StartAppLogger ( )

启动日志保存线程.

◆ StopAppLogger()

void CAppLogger::StopAppLogger ( )

停止日志保存线程

函数调用图:
这是这个函数的调用关系图:

◆ TruncateLogFile()

void CAppLogger::TruncateLogFile ( )

截断日志文件,清除数据

◆ WriteDebug() [1/2]

void CAppLogger::WriteDebug ( const std::string & sFunctionName,
const char * fmt,
... )

添加调试信息到日志队列.

参数
sFunctionName当前执行函数名称或功能名称
fmt字符串格式化内容
函数调用图:

◆ WriteDebug() [2/2]

void CAppLogger::WriteDebug ( const std::string & sFunctionName,
const std::string & sLogMsg )

添加调试信息到日志队列.

参数
sFunctionName执行函数名称
sLogMsg日志内容
这是这个函数的调用关系图:

◆ WriteDebugCompile()

void CAppLogger::WriteDebugCompile ( const std::string & sFunctionName,
const char * fmt,
... )

添加在调试编译下有效的信息到日志队列.

参数
sFunctionName当前执行函数名称或功能名称
fmt字符串格式化内容
函数调用图:

◆ WriteErrorLog() [1/2]

void CAppLogger::WriteErrorLog ( const std::string & sFunctionName,
const char * fmt,
... )

添加错误信息到日志队列.

参数
sFunctionName当前执行函数名称或功能名称
fmt字符串格式化内容
函数调用图:

◆ WriteErrorLog() [2/2]

void CAppLogger::WriteErrorLog ( const std::string & sFunctionName,
const std::string & sLogMsg )

添加错误信息到日志队列.

参数
sFunctionName当前执行函数名称或功能名称
sLogMsg日志内容
这是这个函数的调用关系图:

◆ WriteExceptionLog()

void CAppLogger::WriteExceptionLog ( const std::string & sFunctionName,
const std::exception & ex )

添加异常到日志队列.

参数
sFunctionName当前执行函数名称或功能名称
ex异常错误信息

◆ WriteLog() [1/2]

void CAppLogger::WriteLog ( const std::string & sFunctionName,
const char * fmt,
... )

添加到日志队列.

参数
sFunctionName执行函数名称
fmt字符串格式化内容
函数调用图:

◆ WriteLog() [2/2]

void CAppLogger::WriteLog ( const std::string & sFunctionName,
const std::string & sLogMsg )

添加到日志队列.

参数
sFunctionName执行函数名称
sLogMsg日志内容
这是这个函数的调用关系图:

◆ WriteWaringLog() [1/2]

void CAppLogger::WriteWaringLog ( const std::string & sFunctionName,
const char * fmt,
... )

添加警告信息到日志队列.

参数
sFunctionName当前执行函数名称或功能名称
fmt字符串格式化内容
函数调用图:

◆ WriteWaringLog() [2/2]

void CAppLogger::WriteWaringLog ( const std::string & sFunctionName,
const std::string & sLogMsg )

添加警告信息到日志队列.

参数
sFunctionName当前执行函数名称或功能名称
sLogMsg日志内容
这是这个函数的调用关系图:

该类的文档由以下文件生成:
  • E:/GreatMIMP.Linux.Client/MDWClient/AppLogger.h
  • E:/GreatMIMP.Linux.Client/MDWClient/AppLogger.cpp