[libcalamares] Log to file and stdout consistently

- The log **file** got every QDebug object, while stdout only
  got the ones of sufficient logging level. A CDebug object checks the
  logging level before writing anything -- so those already were
  consistent, but any qDebug() in the program (not cDebug()!) would
  reach the writing-function anyway, and so log to the file.
  Fix this weird inconsistency by checking log-level just once,
  for both writes.
main
Adriaan de Groot 4 years ago
parent 716328cafb
commit b68e535131

@ -69,7 +69,7 @@ logLevel()
static void
log( const char* msg, unsigned int debugLevel, bool withTime = true )
{
if ( true )
if ( logLevelEnabled( debugLevel ) )
{
QMutexLocker lock( &s_mutex );
@ -81,11 +81,7 @@ log( const char* msg, unsigned int debugLevel, bool withTime = true )
<< QString::number( debugLevel ).toUtf8().data() << "]: " << msg << std::endl;
logfile.flush();
}
if ( logLevelEnabled( debugLevel ) )
{
QMutexLocker lock( &s_mutex );
if ( withTime )
{
std::cout << QTime::currentTime().toString().toUtf8().data() << " ["

Loading…
Cancel
Save