remove debug macros

This commit is contained in:
dranik
2026-04-23 14:14:55 +03:00
parent c48bfc0b16
commit 841d18931f

View File

@@ -52,26 +52,19 @@ bool Xray::startXray(const QString &cfg)
// Temporary aid for manual verification of SOCKS auth (inbounds.settings.accounts).
// Debug: always writes. Release: set env AMNEZIA_SAVE_XRAY_CONFIG=1 (if the daemon inherits it).
{
#if defined(MZ_DEBUG)
const bool saveForTest = true;
#else
const bool saveForTest = !qgetenv("AMNEZIA_SAVE_XRAY_CONFIG").isEmpty();
#endif
if (saveForTest) {
#ifdef Q_OS_WIN
const QString debugPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation)
+ QStringLiteral("/amnezia-xray-config.json");
const QString debugPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation)
+ QStringLiteral("/amnezia-xray-config.json");
#else
const QString debugPath = QStringLiteral("/tmp/amnezia-xray-config.json");
const QString debugPath = QStringLiteral("/tmp/amnezia-xray-config.json");
#endif
QFile f(debugPath);
if (f.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
f.write(bytes);
f.close();
qDebug() << "[xray] wrote last config for testing:" << debugPath;
} else {
qWarning() << "[xray] failed to write test config to" << debugPath;
}
QFile f(debugPath);
if (f.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
f.write(bytes);
f.close();
qDebug() << "[xray] wrote last config for testing:" << debugPath;
} else {
qWarning() << "[xray] failed to write test config to" << debugPath;
}
}
if (auto err = amnezia_xray_configure(bytes.data()); err != nullptr) {