1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-21 08:19:42 +01:00

* Fixed and cleaned up Logger class.

This commit is contained in:
Christian Muehlhaeuser 2011-08-14 08:19:48 +02:00
parent 2dc94021e2
commit 5449154ee9
2 changed files with 5 additions and 17 deletions

View File

@ -139,24 +139,14 @@ setupLogfile()
using namespace Logger;
TLog::TLog( unsigned int debugLevel )
: m_debugLevel( debugLevel )
: QDebug( &m_msg )
, m_debugLevel( debugLevel )
{
}
TLog::~TLog()
{
log( m_msgs.join( " " ).toAscii().data(), m_debugLevel );
}
TLog&
TLog::operator<<( const QVariant& v )
{
QString const s = v.toString();
if ( !s.isEmpty() )
m_msgs << s;
return *this;
log( m_msg.toAscii().data(), m_debugLevel );
}

View File

@ -26,16 +26,14 @@
namespace Logger
{
class DLLEXPORT TLog
class DLLEXPORT TLog : public QDebug
{
public:
TLog( unsigned int debugLevel = 0 );
virtual ~TLog();
TLog& operator<<( const QVariant& v );
private:
QStringList m_msgs;
QString m_msg;
unsigned int m_debugLevel;
};