[libcalamares] Massage the logger output
- continuations, for the console, no longer print the date + level, which makes things easier to visually group and read. - the file log is mostly unchanged, except it contains more spaces now.
This commit is contained in:
parent
631923abf8
commit
3565b6806a
@ -79,7 +79,7 @@ logLevel()
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
log( const char* msg, unsigned int debugLevel )
|
log( const char* msg, unsigned int debugLevel, bool withTime = true )
|
||||||
{
|
{
|
||||||
if ( true )
|
if ( true )
|
||||||
{
|
{
|
||||||
@ -98,10 +98,12 @@ log( const char* msg, unsigned int debugLevel )
|
|||||||
if ( logLevelEnabled( debugLevel ) )
|
if ( logLevelEnabled( debugLevel ) )
|
||||||
{
|
{
|
||||||
QMutexLocker lock( &s_mutex );
|
QMutexLocker lock( &s_mutex );
|
||||||
|
if ( withTime )
|
||||||
|
{
|
||||||
std::cout << QTime::currentTime().toString().toUtf8().data() << " ["
|
std::cout << QTime::currentTime().toString().toUtf8().data() << " ["
|
||||||
<< QString::number( debugLevel ).toUtf8().data() << "]: " << msg << std::endl;
|
<< QString::number( debugLevel ).toUtf8().data() << "]: ";
|
||||||
std::cout.flush();
|
}
|
||||||
|
std::cout << msg << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,13 +200,16 @@ CDebug::CDebug( unsigned int debugLevel, const char* func )
|
|||||||
|
|
||||||
|
|
||||||
CDebug::~CDebug()
|
CDebug::~CDebug()
|
||||||
|
{
|
||||||
|
if ( logLevelEnabled( m_debugLevel ) )
|
||||||
{
|
{
|
||||||
if ( m_funcinfo )
|
if ( m_funcinfo )
|
||||||
{
|
{
|
||||||
m_msg.prepend( s_Continuation ); // Prepending, so back-to-front
|
m_msg.prepend( s_Continuation ); // Prepending, so back-to-front
|
||||||
m_msg.prepend( m_funcinfo );
|
m_msg.prepend( m_funcinfo );
|
||||||
}
|
}
|
||||||
log( m_msg.toUtf8().data(), m_debugLevel );
|
log( m_msg.toUtf8().data(), m_debugLevel, m_funcinfo );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr FuncSuppressor::FuncSuppressor( const char s[] )
|
constexpr FuncSuppressor::FuncSuppressor( const char s[] )
|
||||||
|
Loading…
Reference in New Issue
Block a user