[calamares]: Improve startup logging

- Don't bother with the address of the main thread
 - Do put a marker on restart into the log file
 - Do put the Calamares version into the log file (previously, the version
   was printed through cDebug() before the log file was opened, so it was
   lost to the on-disk log).
This commit is contained in:
Adriaan de Groot 2018-03-28 05:01:07 -04:00
parent 24305bd58f
commit 0f289e2552
2 changed files with 10 additions and 3 deletions

View File

@ -65,9 +65,6 @@ CalamaresApplication::CalamaresApplication( int& argc, char* argv[] )
void
CalamaresApplication::init()
{
cDebug() << "CalamaresApplication thread:" << thread();
//TODO: Icon loader
Logger::setupLogfile();
setQuitOnLastWindowClosed( false );

View File

@ -31,6 +31,7 @@
#include <QVariant>
#include "utils/CalamaresUtils.h"
#include "CalamaresVersion.h"
#define LOGFILE_SIZE 1024 * 256
@ -145,9 +146,18 @@ setupLogfile()
}
}
// Since the log isn't open yet, this probably only goes to stdout
cDebug() << "Using log file:" << logFile();
// Lock while (re-)opening the logfile
{
QMutexLocker lock( &s_mutex );
logfile.open( logFile().toLocal8Bit(), std::ios::app );
if ( logfile.tellp() )
logfile << "\n\n" << std::endl;
logfile << "=== START CALAMARES " << CALAMARES_VERSION << std::endl;
}
qInstallMessageHandler( CalamaresLogHandler );
}