From a24fcd5689c76a19441fc9002b79fe55d3c067a8 Mon Sep 17 00:00:00 2001 From: Naomi Kirby Date: Fri, 10 Jan 2025 12:32:41 -0800 Subject: [PATCH] Add timestamp to socksproxy logfile (#10175) --- extension/socks5proxy/bin/sockslogger.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extension/socks5proxy/bin/sockslogger.cpp b/extension/socks5proxy/bin/sockslogger.cpp index 9aa8fe37ae..d30e3d5851 100644 --- a/extension/socks5proxy/bin/sockslogger.cpp +++ b/extension/socks5proxy/bin/sockslogger.cpp @@ -211,8 +211,9 @@ void SocksLogger::logfileHandler(QtMsgType type, const QMessageLogContext& ctx, const QString& msg) { QMutexLocker lock(&m_logFileMutex); if (m_logFileDevice) { - // Write the line into the logfile. - m_logFileDevice->write(msg.toUtf8() + '\n'); + QDateTime now = QDateTime::currentDateTime(); + QString line = now.toString("[dd.MM.yyyy hh:mm:ss.zzz] ") + msg + '\n'; + m_logFileDevice->write(line.toUtf8()); m_logFileDevice->flush(); } }