1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-04 21:27:58 +02: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; using namespace Logger;
TLog::TLog( unsigned int debugLevel ) TLog::TLog( unsigned int debugLevel )
: m_debugLevel( debugLevel ) : QDebug( &m_msg )
, m_debugLevel( debugLevel )
{ {
} }
TLog::~TLog() TLog::~TLog()
{ {
log( m_msgs.join( " " ).toAscii().data(), m_debugLevel ); log( m_msg.toAscii().data(), m_debugLevel );
}
TLog&
TLog::operator<<( const QVariant& v )
{
QString const s = v.toString();
if ( !s.isEmpty() )
m_msgs << s;
return *this;
} }

View File

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