Skip to content

Commit

Permalink
Add timestamp to socksproxy logfile (#10175)
Browse files Browse the repository at this point in the history
  • Loading branch information
oskirby authored Jan 10, 2025
1 parent 5291b30 commit a24fcd5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions extension/socks5proxy/bin/sockslogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down

0 comments on commit a24fcd5

Please sign in to comment.