로드 중...
검색 중...
일치하는 항목 없음
gamslog.h
1
26#ifndef GAMSLOG_H
27#define GAMSLOG_H
28
29#include <지도>
30#include <sstream>
31#include <순서가 없는_세트>
32#include "gamsenum.h"
33#include "gamslib_global.h"
34
35네임스페이스게임{
36
38클래스로거풀
39{
40 구조체대상 집합
41TargetSet() : mDebug(GAMSEnum::DebugLevel::Verbose) {}
42대상 집합(const GAMSEnum::DebugLevel 디버그, FILE *대상 = 0) : mDebug(디버그) {
43mTargets.insert(mTargets.end(), (대상 ? 대상 : stdout));
44}
45 GAMSEnum::DebugLevelm디버그;
46std::unordered_set<FILE*> mTargets;
47};
48
49공개:
50
54
59 공허 registerLogger(const로그 ID logId,const GAMSEnum::DebugLevel 디버그, 파일 *대상 = stdout);
60
63 무효 unregisterLogger(const로그 ID logId);
64
69std::unordered_set<파일*>대상(const로그 ID logId,const GAMSEnum::DebugLevel 디버그)const{
70 if(mBinds.find(logId) == mBinds.end())
71 반환std::unordered_set<FILE*>();
72TargetSet lc = mBinds.at(logId);
73 if(lc.m디버그 <디버그)
74 반환std::unordered_set<FILE*>();
75 반환lc.m대상;
76}
77
81 GAMSEnum::DebugLevel 디버그(const로그 ID logId)const{
82 if(mBinds.count(logId) > 0)
83 반환mBinds.at(logId).mDebug;
84 그밖에
86}
87
88비공개:
89 정적 로거풀*m인스턴스;
90std::map<LogId, TargetSet> mBinds;
91 로거풀() {}
92로거풀(로거풀const&)
93 공허연산자=(LoggerPoolconst&)
94};
95
97클래스로거
98{
99공개:
100
105 로거(const로그ID 로그ID,const GAMSEnum::DebugLevel디버그,const 문자* 어디서)
106: mBufferStream(mBuffer), mWhere(where), mTargets(로거풀::instance().targets(logID, 디버그))
107{}
108
111
114 로거&연산자 <<(std::ostream& (*os)(std::ostream&))
115std::stringstream strStream;
116strStream << os;
117mBufferStream << strStream.str().c_str();
118 반환 *이것;
119}
120
123 로거&연산자 <<(conststd::string& 값)
124mBufferStream << value.c_str();
125 반환 *이것;
126}
127
130 템플릿<유형 이름T>
131 로거&연산자 <<(constT& 값)
132mBufferStream << 값;
133 반환 *이것;
134}
135
136비공개:
137std::string mBuffer;
138std::stringstream mBufferStream;
139std::string mWhere;
140std::unordered_set<FILE*> mTargets;
141};
142
143}
144
145#define DEB_S(logID) ::슬롯 나라::Logger(logID, ::슬롯 나라::GAMSEnum::DebugLevel::Verbose, __FUNCTION__)
146#define DEB ::슬롯 나라::Logger(logID(), ::슬롯 나라::GAMSEnum::DebugLevel::Verbose, __FUNCTION__)
147#define MSG ::슬롯 나라::Logger(logID(), ::슬롯 나라::GAMSEnum::DebugLevel::ShowLog, __FUNCTION__)
148#define ERR ::슬롯 나라::Logger(logID(), ::슬롯 나라::GAMSEnum::DebugLevel::Off, __FUNCTION__)
149//#MSG 정의(ws) ::슬롯 나라::Logger(ws, ::슬롯 나라::GAMSEnum::DebugLevel::ShowLog, __FUNCTION__)
150
151#endif// GAMSLOG_H
디버그레벨
슬롯 나라 디버그 수준.
@ 자세한 설명
고도의 기술 정보와 슬롯 나라 로그를 stdout으로 보내고 임시 파일을 보관하십시오.
@ 끄기
디버그 없음.
API 인스턴스에서 사용되는 모든 로거를 관리하는 클래스입니다.
정적 LoggerPool 및 인스턴스()
GAMSEnum::DebugLevel 디버그(const LogId logId) const
voidregisterLogger(const LogId logId, const GAMSEnum::DebugLevel debug, FILE *target=stdout)
void unregisterLogger(const LogId logId)
std::unordered_set< FILE * > target(const LogId logId, const GAMSEnum::DebugLevel debug) const
API 작업에 대한 피드백을 얻는 데 사용되는 로깅 클래스.
로거(const LogId logID, const GAMSEnum::DebugLevel debug, const char *where)
로거 및 연산자<<(std::ostream &(*os)(std::ostream &))