MCPcopy Create free account
hub / github.com/BatchDrake/SigDigger / getLogText

Function getLogText

main.cpp:50–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50static QString
51getLogText(void)
52{
53 QString text = "";
54 std::lock_guard<Suscan::Logger> guard(*Suscan::Logger::getInstance());
55
56 auto begin = Suscan::Logger::getInstance()->begin();
57 auto end = Suscan::Logger::getInstance()->end();
58
59 if (end - begin > MAX_LOG_MESSAGES) {
60 auto removed = end - begin - MAX_LOG_MESSAGES;
61 begin = end - MAX_LOG_MESSAGES;
62
63 text += "(" + QString::number(removed) + " previous messages omitted)\n";
64 }
65
66 for (auto p = begin; p != end; ++p) {
67 switch (p->severity) {
68 case SU_LOG_SEVERITY_CRITICAL:
69 text += "critical: ";
70 break;
71
72 case SU_LOG_SEVERITY_DEBUG:
73 text += "debug: ";
74 break;
75
76 case SU_LOG_SEVERITY_ERROR:
77 text += "error: ";
78 break;
79
80 case SU_LOG_SEVERITY_INFO:
81 text += "info: ";
82 break;
83
84 case SU_LOG_SEVERITY_WARNING:
85 text += "warning: ";
86 break;
87 }
88
89 text += p->message.c_str();
90 }
91
92 return text;
93}
94
95static int
96runSigDigger(QApplication &app)

Callers 6

runSigDiggerFunction · 0.85
startCaptureMethod · 0.85
onAnalyzerEosMethod · 0.85
onAnalyzerReadErrorMethod · 0.85
onPanSpectrumStartMethod · 0.85
onScannerStoppedMethod · 0.85

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected