MCPcopy Create free account
hub / github.com/Hashiao/wuwaBackendTool / shouldLog

Method shouldLog

commonTools/debugmessagehandler.h:199–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197
198
199 bool shouldLog(QtMsgType type) {
200 // 定义枚举优先级映射
201 static const std::map<QtMsgType, int> logPriority = {
202 {QtDebugMsg, 0},
203 {QtInfoMsg, 1},
204 {QtWarningMsg, 2},
205 {QtCriticalMsg, 3},
206 {QtFatalMsg, 4}
207 };
208
209 // 确保 logLevel 也有一个对应的优先级值
210 int logLevelPriority = logPriority.at(logLevel);
211
212 // 比较当前消息类型的优先级是否 >= logLevel 的优先级
213 auto it = logPriority.find(type);
214 if (it != logPriority.end()) {
215 return it->second >= logLevelPriority;
216 }
217
218 // 如果消息类型未定义,默认不记录
219 return false;
220 }
221
222 QPlainTextEdit* editor;
223 QMutex mutex;

Callers 1

messageHandlerMethod · 0.80

Calls 3

findMethod · 0.80
atMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected