1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 06:07:37 +02:00

Better logging

This commit is contained in:
Uwe L. Korn
2014-07-07 16:10:50 +01:00
parent 076c65e1f8
commit 6011b2c973
4 changed files with 9 additions and 9 deletions

View File

@@ -115,7 +115,7 @@ MusixMatchPlugin::trackSearchSlot()
QDomDocument doc; QDomDocument doc;
doc.setContent(oldReply->readAll()); doc.setContent(oldReply->readAll());
qDebug() << doc.toString(); qDebug() << Q_FUNC_INFO << doc.toString();
QDomNodeList domNodeList = doc.elementsByTagName("track_id"); QDomNodeList domNodeList = doc.elementsByTagName("track_id");
if ( domNodeList.isEmpty() ) if ( domNodeList.isEmpty() )
{ {

View File

@@ -87,7 +87,7 @@ LastFmInfoPlugin::init()
LastFmInfoPlugin::~LastFmInfoPlugin() LastFmInfoPlugin::~LastFmInfoPlugin()
{ {
qDebug() << Q_FUNC_INFO; tLog( LOGVERBOSE ) << Q_FUNC_INFO;
delete m_scrobbler; delete m_scrobbler;
m_scrobbler = 0; m_scrobbler = 0;
} }
@@ -914,7 +914,7 @@ LastFmInfoPlugin::settingsChanged()
else if ( m_account.data()->username() != lastfm::ws::Username || else if ( m_account.data()->username() != lastfm::ws::Username ||
m_account.data()->password() != m_pw ) m_account.data()->password() != m_pw )
{ {
qDebug() << "Last.fm credentials changed, re-creating scrobbler"; tDebug() << Q_FUNC_INFO << "Last.fm credentials changed, re-creating scrobbler";
lastfm::ws::Username = m_account.data()->username(); lastfm::ws::Username = m_account.data()->username();
m_pw = m_account.data()->password(); m_pw = m_account.data()->password();
// credentials have changed, have to re-create scrobbler for them to take effect // credentials have changed, have to re-create scrobbler for them to take effect
@@ -962,7 +962,7 @@ LastFmInfoPlugin::onAuthenticated()
else else
error += "."; error += ".";
tLog() << error.simplified(); tLog() << Q_FUNC_INFO << error.simplified();
} }
authJob->deleteLater(); authJob->deleteLater();
@@ -977,7 +977,7 @@ LastFmInfoPlugin::createScrobbler()
if ( m_account.data()->sessionKey().isEmpty() ) // no session key, so get one if ( m_account.data()->sessionKey().isEmpty() ) // no session key, so get one
{ {
qDebug() << "LastFmInfoPlugin::createScrobbler Session key is empty"; tLog() << Q_FUNC_INFO << "Session key is empty";
QString authToken = TomahawkUtils::md5( ( lastfm::ws::Username.toLower() + TomahawkUtils::md5( m_pw.toUtf8() ) ).toUtf8() ); QString authToken = TomahawkUtils::md5( ( lastfm::ws::Username.toLower() + TomahawkUtils::md5( m_pw.toUtf8() ) ).toUtf8() );
QMap<QString, QString> query; QMap<QString, QString> query;
@@ -990,7 +990,7 @@ LastFmInfoPlugin::createScrobbler()
} }
else else
{ {
qDebug() << "LastFmInfoPlugin::createScrobbler Already have session key"; tLog() << Q_FUNC_INFO << "LastFmInfoPlugin::createScrobbler Already have session key";
lastfm::ws::SessionKey = m_account.data()->sessionKey(); lastfm::ws::SessionKey = m_account.data()->sessionKey();
m_scrobbler = new lastfm::Audioscrobbler( "thk" ); m_scrobbler = new lastfm::Audioscrobbler( "thk" );
@@ -1013,7 +1013,7 @@ LastFmInfoPlugin::parseTrackList( QNetworkReply* reply )
} }
catch ( lastfm::ws::ParseError& e ) catch ( lastfm::ws::ParseError& e )
{ {
qWarning() << e.message(); tLog() << Q_FUNC_INFO << e.message();
} }
return tracks; return tracks;

View File

@@ -1367,7 +1367,7 @@ SpotifyAccount::playlistCopyCreated( const QString& msgType, const QVariantMap&
const QString qid = msg.value( "qid" ).toString(); const QString qid = msg.value( "qid" ).toString();
const QString title = msg.value( "playlistname" ).toString(); const QString title = msg.value( "playlistname" ).toString();
qDebug() << msg; qDebug() << Q_FUNC_INFO << msg;
if ( !m_waitingForCreateReply.contains( qid ) ) if ( !m_waitingForCreateReply.contains( qid ) )
{ {
qWarning() << "Got a createPlaylist reply for a playlist/qid we were not waiting for :-/ " << qid << m_waitingForCreateReply; qWarning() << "Got a createPlaylist reply for a playlist/qid we were not waiting for :-/ " << qid << m_waitingForCreateReply;

View File

@@ -750,7 +750,7 @@ SpotifyPlaylistUpdater::tomahawkTracksMoved( const QList< plentry_ptr >& tracks,
qDebug() << Q_FUNC_INFO << "Got tracks moved at position:" << position; qDebug() << Q_FUNC_INFO << "Got tracks moved at position:" << position;
foreach ( const plentry_ptr& ple, tracks ) foreach ( const plentry_ptr& ple, tracks )
{ {
qDebug() << ple->query()->queryTrack()->toString(); qDebug() << Q_FUNC_INFO << ple->query()->queryTrack()->toString();
} }
qDebug() << Q_FUNC_INFO << "updating spotify resolver with moved tracks to:" << position; qDebug() << Q_FUNC_INFO << "updating spotify resolver with moved tracks to:" << position;