diff --git a/src/libcalamaresui/utils/Paste.cpp b/src/libcalamaresui/utils/Paste.cpp index ea20dc8b2..2f0cfa143 100644 --- a/src/libcalamaresui/utils/Paste.cpp +++ b/src/libcalamaresui/utils/Paste.cpp @@ -28,10 +28,11 @@ using namespace CalamaresUtils::Units; STATICTEST QByteArray logFileContents() { - QFile pasteSourceFile( Logger::logFile() ); + const QString name = Logger::logFile(); + QFile pasteSourceFile( name ); if ( !pasteSourceFile.open( QIODevice::ReadOnly | QIODevice::Text ) ) { - cError() << "Could not open log file"; + cWarning() << "Could not open log file" << name; return QByteArray(); } QFileInfo fi( pasteSourceFile ); diff --git a/src/libcalamaresui/utils/TestPaste.cpp b/src/libcalamaresui/utils/TestPaste.cpp index ff75be02d..d21d6b81e 100644 --- a/src/libcalamaresui/utils/TestPaste.cpp +++ b/src/libcalamaresui/utils/TestPaste.cpp @@ -35,15 +35,16 @@ private Q_SLOTS: void TestPaste::testGetLogFile() { + QFile::remove( Logger::logFile() ); // This test assumes nothing **else** has set up logging yet - QByteArray b = logFileContents(); - QVERIFY( b.isEmpty() ); + QByteArray contentsOfLogfileBefore = logFileContents(); + QVERIFY( contentsOfLogfileBefore.isEmpty() ); Logger::setupLogLevel( Logger::LOGDEBUG ); Logger::setupLogfile(); - b = logFileContents(); - QVERIFY( !b.isEmpty() ); + QByteArray contentsOfLogfileAfterSetup = logFileContents(); + QVERIFY( !contentsOfLogfileAfterSetup.isEmpty() ); } void