Dump config during connection tests only when enabled

by setting environment variable SYNCTHING_TEST_DUMP_CONFIG_UPDATES
This commit is contained in:
Martchus 2017-08-21 01:00:41 +02:00
parent 89abe204c1
commit cc6fec91c1
1 changed files with 4 additions and 2 deletions

View File

@ -123,8 +123,10 @@ void ConnectionTests::setUp()
[this] { cerr << " - Connection status changed to: " << m_connection.statusText().toLocal8Bit().data() << endl; });
// log configuration change
QObject::connect(&m_connection, &SyncthingConnection::newConfig,
[](const QJsonObject &config) { cerr << " - New config: " << QJsonDocument(config).toJson(QJsonDocument::Indented).data() << endl; });
if (qEnvironmentVariableIsSet("SYNCTHING_TEST_DUMP_CONFIG_UPDATES")) {
QObject::connect(&m_connection, &SyncthingConnection::newConfig,
[](const QJsonObject &config) { cerr << " - New config: " << QJsonDocument(config).toJson(QJsonDocument::Indented).data() << endl; });
}
// log errors
QObject::connect(&m_connection, &SyncthingConnection::error,