[libcalamares] Un-clog Logging
- Map QtMsgType -- used by qDebug() and qWarning() -- to levels used by Calamares in a consistent fashion. - Drop unused log levels (INFO, EXTRA unused in any Calamares code).
This commit is contained in:
parent
ddcfd861cc
commit
716328cafb
@ -33,7 +33,7 @@ static unsigned int s_threshold =
|
|||||||
#ifdef QT_NO_DEBUG
|
#ifdef QT_NO_DEBUG
|
||||||
Logger::LOG_DISABLE;
|
Logger::LOG_DISABLE;
|
||||||
#else
|
#else
|
||||||
Logger::LOGEXTRA + 1; // Comparison is < in log() function
|
Logger::LOGDEBUG; // Comparison is < in log() function
|
||||||
#endif
|
#endif
|
||||||
static QMutex s_mutex;
|
static QMutex s_mutex;
|
||||||
|
|
||||||
@ -105,20 +105,21 @@ CalamaresLogHandler( QtMsgType type, const QMessageLogContext&, const QString& m
|
|||||||
const char* message = ba.constData();
|
const char* message = ba.constData();
|
||||||
|
|
||||||
QMutexLocker locker( &s_mutex );
|
QMutexLocker locker( &s_mutex );
|
||||||
|
|
||||||
switch ( type )
|
switch ( type )
|
||||||
{
|
{
|
||||||
case QtDebugMsg:
|
case QtInfoMsg:
|
||||||
log( message, LOGVERBOSE );
|
log( message, LOGVERBOSE );
|
||||||
break;
|
break;
|
||||||
|
case QtDebugMsg:
|
||||||
case QtInfoMsg:
|
log( message, LOGDEBUG );
|
||||||
log( message, 1 );
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QtCriticalMsg:
|
|
||||||
case QtWarningMsg:
|
case QtWarningMsg:
|
||||||
|
log( message, LOGWARNING );
|
||||||
|
break;
|
||||||
|
case QtCriticalMsg:
|
||||||
case QtFatalMsg:
|
case QtFatalMsg:
|
||||||
log( message, 0 );
|
log( message, LOGERROR );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,8 +47,6 @@ enum
|
|||||||
LOG_DISABLE = 0,
|
LOG_DISABLE = 0,
|
||||||
LOGERROR = 1,
|
LOGERROR = 1,
|
||||||
LOGWARNING = 2,
|
LOGWARNING = 2,
|
||||||
LOGINFO = 3,
|
|
||||||
LOGEXTRA = 5,
|
|
||||||
LOGDEBUG = 6,
|
LOGDEBUG = 6,
|
||||||
LOGVERBOSE = 8
|
LOGVERBOSE = 8
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user