[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
@ -69,7 +69,7 @@ logLevel()
|
|||||||
static void
|
static void
|
||||||
log( const char* msg, unsigned int debugLevel, bool withTime = true )
|
log( const char* msg, unsigned int debugLevel, bool withTime = true )
|
||||||
{
|
{
|
||||||
if ( true )
|
if ( logLevelEnabled( debugLevel ) )
|
||||||
{
|
{
|
||||||
QMutexLocker lock( &s_mutex );
|
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;
|
<< QString::number( debugLevel ).toUtf8().data() << "]: " << msg << std::endl;
|
||||||
|
|
||||||
logfile.flush();
|
logfile.flush();
|
||||||
}
|
|
||||||
|
|
||||||
if ( logLevelEnabled( debugLevel ) )
|
|
||||||
{
|
|
||||||
QMutexLocker lock( &s_mutex );
|
|
||||||
if ( withTime )
|
if ( withTime )
|
||||||
{
|
{
|
||||||
std::cout << QTime::currentTime().toString().toUtf8().data() << " ["
|
std::cout << QTime::currentTime().toString().toUtf8().data() << " ["
|
||||||
|
Loading…
Reference in New Issue
Block a user