C++客户端开发接口库
V5.1.8.15
连接信创集成中间件服务程序的二次开发接口
Toggle main menu visibility
载入中...
搜索中...
未找到
LogQueue.h
1
#pragma once
2
#include <string>
3
#include <list>
4
#include <mutex>
5
#include <chrono>
6
7
namespace
mdwc
8
{
10
enum
LOGLEVEL
11
{
13
llError
= 0,
15
llWarning
= 1,
17
llNormal
= 2,
19
llDebug
= 3
20
};
21
23
struct
MDWLogMsg
24
{
26
std::chrono::system_clock::time_point
dtTime
;
28
LOGLEVEL
Level
;
30
std::string
sFunctionName
;
32
std::string
sLogMessage
;
33
};
34
36
static
const
size_t
MAX_QUEUE_SIZE = 100000;
37
39
class
CLogQueue
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
}
mdwc::CLogQueue::Pop
bool Pop(MDWLogMsg &logmsg)
定义
LogQueue.cpp:136
mdwc::CLogQueue::PushError
void PushError(const std::string &sFunctionName, const std::string &sLogMsg)
定义
LogQueue.cpp:76
mdwc::CLogQueue::PushWarning
void PushWarning(const std::string &sFunctionName, const std::string &sLogMsg)
定义
LogQueue.cpp:95
mdwc::CLogQueue::CLogQueue
CLogQueue()
定义
LogQueue.cpp:6
mdwc::CLogQueue::WriteFinished
bool WriteFinished()
定义
LogQueue.cpp:147
mdwc::CLogQueue::Push
void Push(LOGLEVEL Level, const std::string &sFunctionName, const std::list< std::string > &lstMsg)
定义
LogQueue.cpp:16
mdwc
定义
AutoUpdateHelper.h:8
mdwc::LOGLEVEL
LOGLEVEL
定义
LogQueue.h:11
mdwc::llNormal
@ llNormal
定义
LogQueue.h:17
mdwc::llDebug
@ llDebug
定义
LogQueue.h:19
mdwc::llError
@ llError
定义
LogQueue.h:13
mdwc::llWarning
@ llWarning
定义
LogQueue.h:15
mdwc::MDWLogMsg
定义
LogQueue.h:24
mdwc::MDWLogMsg::sFunctionName
std::string sFunctionName
定义
LogQueue.h:30
mdwc::MDWLogMsg::sLogMessage
std::string sLogMessage
定义
LogQueue.h:32
mdwc::MDWLogMsg::Level
LOGLEVEL Level
定义
LogQueue.h:28
mdwc::MDWLogMsg::dtTime
std::chrono::system_clock::time_point dtTime
定义
LogQueue.h:26
MDWClient
LogQueue.h
制作者
1.18.0