From 5449154ee9f1df22f537b27e23e6be963c58ff96 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Sun, 14 Aug 2011 08:19:48 +0200 Subject: [PATCH] * Fixed and cleaned up Logger class. --- src/libtomahawk/utils/logger.cpp | 16 +++------------- src/libtomahawk/utils/logger.h | 6 ++---- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/src/libtomahawk/utils/logger.cpp b/src/libtomahawk/utils/logger.cpp index 522fa68b1..2a53b871c 100644 --- a/src/libtomahawk/utils/logger.cpp +++ b/src/libtomahawk/utils/logger.cpp @@ -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 ); } diff --git a/src/libtomahawk/utils/logger.h b/src/libtomahawk/utils/logger.h index 2bc76f88d..76b95f9da 100644 --- a/src/libtomahawk/utils/logger.h +++ b/src/libtomahawk/utils/logger.h @@ -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; };