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

Better logging

This commit is contained in:
Uwe L. Korn 2014-09-17 18:48:48 +01:00
parent af313a3dc6
commit 2f44f64692
2 changed files with 7 additions and 2 deletions

View File

@ -101,7 +101,11 @@ Source::setControlConnection( ControlConnection* cc )
if ( !d->cc.isNull() && d->cc->isReady() && d->cc->isRunning() )
{
const QString& nodeid = Database::instance()->impl()->dbid();
peerInfoDebug( (*cc->peerInfos().begin()) ) << Q_FUNC_INFO << "Comparing" << cc->id() << "and" << nodeid << "to detect duplicate connection, outbound:" << cc->outbound();
peerInfoDebug( (*cc->peerInfos().begin()) ) << Q_FUNC_INFO
<< "Comparing" << cc->id()
<< "and" << nodeid
<< "to detect duplicate connections"
<< "outbound:" << cc->outbound();
// If our nodeid is "higher" than the other, we prefer inbound connection, else outbound.
if ( ( cc->id() < nodeid && d->cc->outbound() ) || ( cc->id() > nodeid && !d->cc->outbound() ) )
{

View File

@ -146,6 +146,7 @@ ControlConnection::setup()
}
else
{
tLog() << Q_FUNC_INFO << "We are a duplicate secondary connection, so dropping.";
// We are not responsible for this source anymore, so do not keep a reference.
d->source = Tomahawk::source_ptr();
// Unlock before we delete ourselves
@ -172,7 +173,7 @@ ControlConnection::registerSource()
// Only continue if we are still the ControlConnection associated with this source.
if ( d->source->controlConnection() == this )
{
qDebug() << Q_FUNC_INFO << d->source->id();
tLog( LOGVERBOSE ) << Q_FUNC_INFO << d->source->id();
Source* source = (Source*) sender();
Q_UNUSED( source )
Q_ASSERT( source == d->source.data() );