MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / initializeLogTail

Method initializeLogTail

src/gui/NetworkDiagnosticsDialog.cpp:1916–1942  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1914}
1915
1916void NetworkDiagnosticsDialog::initializeLogTail()
1917{
1918 const QString logPath = LogManager::instance().logFilePath();
1919 if (m_logPathLabel) {
1920 m_logPathLabel->setText(QString("Log: %1").arg(logPath));
1921 }
1922
1923 m_logFile.close();
1924 m_logFile.setFileName(logPath);
1925 m_logOffset = 0;
1926 m_logPartialLine.clear();
1927 m_logLines.clear();
1928
1929 if (!reopenLogFile(false)) {
1930 rebuildLogView();
1931 return;
1932 }
1933
1934 static constexpr qint64 kInitialTailBytes = 128 * 1024;
1935 const qint64 size = m_logFile.size();
1936 if (size > kInitialTailBytes) {
1937 m_logFile.seek(size - kInitialTailBytes);
1938 m_logFile.readLine();
1939 }
1940 m_logOffset = m_logFile.pos();
1941 appendNewLogData();
1942}
1943
1944bool NetworkDiagnosticsDialog::reopenLogFile(bool keepExistingLines)
1945{

Callers

nothing calls this directly

Calls 4

logFilePathMethod · 0.45
closeMethod · 0.45
clearMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected