Commit 5248a37e authored by Adriaan de Groot's avatar Adriaan de Groot

[libcalamares] Add FUNC_INFO into all debug messages

- This is needlessly verbose
- Chase CreatePartitionTableJob which needs to bind to a temporary
parent 3ddee809
......@@ -172,9 +172,10 @@ setupLogfile()
qInstallMessageHandler( CalamaresLogHandler );
}
CDebug::CDebug( unsigned int debugLevel )
CDebug::CDebug( unsigned int debugLevel, const char* func )
: QDebug( &m_msg )
, m_debugLevel( debugLevel )
, m_funcinfo( func )
{
if ( debugLevel <= LOGERROR )
{
......@@ -189,6 +190,11 @@ CDebug::CDebug( unsigned int debugLevel )
CDebug::~CDebug()
{
if ( m_funcinfo )
{
m_msg.prepend( Continuation );
m_msg.prepend( m_funcinfo );
}
log( m_msg.toUtf8().data(), m_debugLevel );
}
......
......@@ -44,12 +44,13 @@ enum
class DLLEXPORT CDebug : public QDebug
{
public:
explicit CDebug( unsigned int debugLevel = LOGDEBUG );
explicit CDebug( unsigned int debugLevel = LOGDEBUG, const char* func = nullptr );
virtual ~CDebug();
private:
QString m_msg;
unsigned int m_debugLevel;
const char* m_funcinfo = nullptr;
};
/**
......@@ -201,8 +202,8 @@ operator<<( QDebug& s, const DebugMap& t )
}
} // namespace Logger
#define cDebug() ( Logger::CDebug( Logger::LOGDEBUG ) << Q_FUNC_INFO << Logger::Continuation )
#define cWarning() Logger::CDebug( Logger::LOGWARNING )
#define cError() Logger::CDebug( Logger::LOGERROR )
#define cDebug() Logger::CDebug( Logger::LOGDEBUG, Q_FUNC_INFO )
#define cWarning() Logger::CDebug( Logger::LOGWARNING, Q_FUNC_INFO )
#define cError() Logger::CDebug( Logger::LOGERROR, Q_FUNC_INFO )
#endif
......@@ -69,7 +69,7 @@ CreatePartitionTableJob::prettyStatusMessage() const
static inline QDebug&
operator <<( QDebug& s, PartitionIterator& it )
operator <<( QDebug&& s, PartitionIterator& it )
{
s << ( ( *it ) ? ( *it )->deviceNode() : QString( "<null device>" ) );
return s;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment