mirror of
https://github.com/parchlinux/calamares.git
synced 2025-07-01 19:35:36 -04:00
[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.
This commit is contained in:
parent
716328cafb
commit
b68e535131
1 changed files with 1 additions and 5 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue