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

* Cleanup debug output a bit.

This commit is contained in:
Christian Muehlhaeuser 2011-09-12 07:28:40 +02:00
parent 2c9c5ea8bb
commit f48c2c9b5c
5 changed files with 24 additions and 8 deletions

View File

@ -26,6 +26,9 @@
#include "database/databasecommandloggable.h"
#include "utils/logger.h"
#ifndef QT_NO_DEBUG
//#define DEBUG_TIMING TRUE
#endif
DatabaseWorker::DatabaseWorker( DatabaseImpl* lib, Database* db, bool mutates )
: QThread()
@ -46,7 +49,12 @@ DatabaseWorker::~DatabaseWorker()
tDebug() << Q_FUNC_INFO << m_outstanding;
if ( m_outstanding )
tDebug() << "Outstanding db commands to finish:" << m_commands;
{
foreach ( const QSharedPointer<DatabaseCommand>& cmd, m_commands )
{
tDebug() << "Outstanding db command to finish:" << cmd->guid() << cmd->commandname();
}
}
thread()->quit();
wait();
@ -91,8 +99,10 @@ DatabaseWorker::doWork()
*/
#ifdef DEBUG_TIMING
QTime timer;
timer.start();
#endif
QSharedPointer<DatabaseCommand> cmd;
{
@ -160,10 +170,16 @@ DatabaseWorker::doWork()
}
}
//uint duration = timer.elapsed();
//qDebug() << "DBCmd Duration:" << duration << "ms, now running postcommit for" << cmd->commandname();
#ifdef DEBUG_TIMING
uint duration = timer.elapsed();
tDebug() << "DBCmd Duration:" << duration << "ms, now running postcommit for" << cmd->commandname();
#endif
cmd->postCommit();
//qDebug() << "Post commit finished for"<< cmd->commandname();
#ifdef DEBUG_TIMING
tDebug() << "Post commit finished in" << timer.elapsed() - duration << "ms for" << cmd->commandname();
#endif
}
}
catch( const char * msg )

View File

@ -59,7 +59,7 @@ public:
int e = t.elapsed();
if ( e >= TOMAHAWK_QUERY_THRESHOLD )
tLog() << "TomahawkSqlQuery (" << lastQuery() << ") finished in" << t.elapsed() << "ms";
tLog( LOGVERBOSE ) << "TomahawkSqlQuery (" << lastQuery() << ") finished in" << t.elapsed() << "ms";
return ret;
}

View File

@ -337,7 +337,7 @@ Pipeline::shunt( const query_ptr& q )
if ( r )
{
tDebug() << "Dispatching to resolver" << r->name() << q->toString() << q->solved() << q->id();
tLog( LOGEXTRA ) << "Dispatching to resolver" << r->name() << q->toString() << q->solved() << q->id();
q->setCurrentResolver( r );
r->resolve( q );

View File

@ -200,7 +200,7 @@ Query::removeResult( const Tomahawk::result_ptr& result )
void
Query::onResolvingFinished()
{
tDebug() << "Finished resolving:" << toString();
tDebug( LOGVERBOSE ) << "Finished resolving:" << toString();
if ( !m_resolveFinished )
{
m_resolveFinished = true;

View File

@ -72,7 +72,7 @@ log( const char *msg, unsigned int debugLevel, bool toDisk = true )
logfile.flush();
}
if ( debugLevel <= LOGVERBOSE || (int)debugLevel <= s_threshold )
if ( debugLevel <= LOGEXTRA || (int)debugLevel <= s_threshold )
{
cout << msg << endl;
cout.flush();