C++客户端开发接口库 V5.1.8.15
连接信创集成中间件服务程序的二次开发接口
载入中...
搜索中...
未找到
LogQueue.h
1#pragma once
2#include <string>
3#include <list>
4#include <mutex>
5#include <chrono>
6
7namespace mdwc
8{
11 {
20 };
21
23 struct MDWLogMsg
24 {
26 std::chrono::system_clock::time_point dtTime;
30 std::string sFunctionName;
32 std::string sLogMessage;
33 };
34
36 static const size_t MAX_QUEUE_SIZE = 100000;
37
40 {
41 private:
43 std::list<MDWLogMsg> m_LogMsgQuenue;
44 std::mutex m_LogMsgQuenueMutex;
45 public:
52 void Push(LOGLEVEL Level, const std::string& sFunctionName, const std::list<std::string>& lstMsg);
53
60 void Push(LOGLEVEL Level, const std::string& sFunctionName, const std::string& sLogMsg);
61
68 void Push(LOGLEVEL Level, const std::string& sFunctionName, const char* fmt, ...);
69
75 void PushError(const std::string& sFunctionName, const std::string& sLogMsg);
81 void PushError(const std::string& sFunctionName, const char* fmt, ...);
82
88 void PushWarning(const std::string& sFunctionName, const std::string& sLogMsg);
89
95 void PushWarning(const std::string& sFunctionName, const char* fmt, ...);
96
102 void Push(const std::string& sFunctionName, const std::exception& ex);
103
109 bool Pop(MDWLogMsg& logmsg);
110
115 bool WriteFinished();
116 public:
118 CLogQueue();
120 ~CLogQueue();
121 };
122}
bool Pop(MDWLogMsg &logmsg)
定义 LogQueue.cpp:136
void PushError(const std::string &sFunctionName, const std::string &sLogMsg)
定义 LogQueue.cpp:76
void PushWarning(const std::string &sFunctionName, const std::string &sLogMsg)
定义 LogQueue.cpp:95
CLogQueue()
定义 LogQueue.cpp:6
bool WriteFinished()
定义 LogQueue.cpp:147
void Push(LOGLEVEL Level, const std::string &sFunctionName, const std::list< std::string > &lstMsg)
定义 LogQueue.cpp:16
定义 AutoUpdateHelper.h:8
LOGLEVEL
定义 LogQueue.h:11
@ llNormal
定义 LogQueue.h:17
@ llDebug
定义 LogQueue.h:19
@ llError
定义 LogQueue.h:13
@ llWarning
定义 LogQueue.h:15
定义 LogQueue.h:24
std::string sFunctionName
定义 LogQueue.h:30
std::string sLogMessage
定义 LogQueue.h:32
LOGLEVEL Level
定义 LogQueue.h:28
std::chrono::system_clock::time_point dtTime
定义 LogQueue.h:26