MCPcopy Create free account
hub / github.com/Adaptix-Framework/AdaptixC2 / AddLogs

Method AddLogs

AdaptixClient/Source/UI/Widgets/LogsWidget.cpp:171–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171void LogsWidget::AddLogs(const int type, const qint64 time, const QString &message)
172{
173 const auto& theme = ConsoleThemeManager::instance().theme();
174
175 QString sTime = UnixTimestampGlobalToStringLocal(time);
176 QString logTime = QString("[%1] -> ").arg(sTime);
177 logsConsoleTextEdit->appendFormatted(logTime, [&](QTextCharFormat& fmt){ fmt = theme.logDebug.toFormat(); });
178
179 QString logMsg = message + "\n";
180
181 if( type == EVENT_CLIENT_CONNECT ) logsConsoleTextEdit->appendFormatted(logMsg, [&](QTextCharFormat& fmt){ fmt = theme.operatorConnect.toFormat(); });
182 else if( type == EVENT_CLIENT_DISCONNECT ) logsConsoleTextEdit->appendFormatted(logMsg, [&](QTextCharFormat& fmt){ fmt = theme.operatorDisconnect.toFormat(); });
183 else if( type == EVENT_LISTENER_START ) logsConsoleTextEdit->appendFormatted(logMsg, [&](QTextCharFormat& fmt){ fmt = theme.listenerStart.toFormat(); });
184 else if( type == EVENT_LISTENER_STOP ) logsConsoleTextEdit->appendFormatted(logMsg, [&](QTextCharFormat& fmt){ fmt = theme.listenerStop.toFormat(); });
185 else if( type == EVENT_AGENT_NEW ) logsConsoleTextEdit->appendFormatted(logMsg, [&](QTextCharFormat& fmt){ fmt = theme.agentNew.toFormat(); });
186 else if( type == EVENT_TUNNEL_START ) logsConsoleTextEdit->appendFormatted(logMsg, [&](QTextCharFormat& fmt){ fmt = theme.tunnel.toFormat(); });
187 else if( type == EVENT_TUNNEL_STOP ) logsConsoleTextEdit->appendFormatted(logMsg, [&](QTextCharFormat& fmt){ fmt = theme.tunnel.toFormat(); });
188 else logsConsoleTextEdit->appendPlain(logMsg);
189}
190
191void LogsWidget::applyTheme()
192{

Callers 1

processSyncPacketMethod · 0.80

Calls 5

appendFormattedMethod · 0.80
toFormatMethod · 0.80
appendPlainMethod · 0.80
QStringClass · 0.50

Tested by

no test coverage detected