1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-10 08:04:25 +02:00

Quiet down logging a bit.

This commit is contained in:
Christian Muehlhaeuser
2014-10-30 09:40:49 +01:00
parent 26f87e8b7a
commit 854c32e8e8
9 changed files with 29 additions and 26 deletions

View File

@@ -254,10 +254,10 @@ WebSocket::readOutput()
std::string outputString = m_outputStream.str(); std::string outputString = m_outputStream.str();
if ( outputString.size() > 0 ) if ( outputString.size() > 0 )
{ {
m_outputStream.str(""); m_outputStream.str( "" );
qint64 sizeWritten = m_socket->write( outputString.data(), outputString.size() ); qint64 sizeWritten = m_socket->write( outputString.data(), outputString.size() );
tDebug() << Q_FUNC_INFO << "Got " << outputString.size() << "from outstream, wrote" << sizeWritten << "bytes to the socket"; // tDebug() << Q_FUNC_INFO << "Got" << outputString.size() << "from outstream, wrote" << sizeWritten << "bytes to the socket";
if ( sizeWritten == -1 ) if ( sizeWritten == -1 )
{ {
tLog() << Q_FUNC_INFO << "Error during writing, closing connection"; tLog() << Q_FUNC_INFO << "Error during writing, closing connection";
@@ -291,6 +291,7 @@ WebSocket::readOutput()
} }
} }
void void
WebSocket::socketReadyRead() WebSocket::socketReadyRead()
{ {
@@ -311,7 +312,8 @@ WebSocket::socketReadyRead()
QByteArray buf; QByteArray buf;
buf.resize( bytes ); buf.resize( bytes );
qint64 bytesRead = m_socket->read( buf.data(), bytes ); qint64 bytesRead = m_socket->read( buf.data(), bytes );
tDebug() << Q_FUNC_INFO << "Bytes available: " << bytes << ", bytes read:" << bytesRead; // << ", content is" << websocketpp::utility::to_hex( buf.constData(), bytesRead ).data(); // tDebug() << Q_FUNC_INFO << "Bytes available:" << bytes << ", bytes read:" << bytesRead;
// << ", content is" << websocketpp::utility::to_hex( buf.constData(), bytesRead ).data();
if ( bytesRead != bytes ) if ( bytesRead != bytes )
{ {
tLog() << Q_FUNC_INFO << "Error occurred during socket read. Something is wrong; disconnecting"; tLog() << Q_FUNC_INFO << "Error occurred during socket read. Something is wrong; disconnecting";
@@ -349,6 +351,7 @@ WebSocket::encodeMessage( const QByteArray &bytes )
QMetaObject::invokeMethod( this, "readOutput", Qt::QueuedConnection ); QMetaObject::invokeMethod( this, "readOutput", Qt::QueuedConnection );
} }
void void
onMessage( WebSocket* ws, websocketpp::connection_hdl, hatchet_client::message_ptr msg ) onMessage( WebSocket* ws, websocketpp::connection_hdl, hatchet_client::message_ptr msg )
{ {
@@ -357,6 +360,7 @@ onMessage( WebSocket* ws, websocketpp::connection_hdl, hatchet_client::message_p
ws->decodedMessage( QByteArray( payload.data(), payload.length() ) ); ws->decodedMessage( QByteArray( payload.data(), payload.length() ) );
} }
void void
onClose( WebSocket *ws, websocketpp::connection_hdl ) onClose( WebSocket *ws, websocketpp::connection_hdl )
{ {

View File

@@ -93,7 +93,7 @@ CredentialsManager::loadCredentials( const QString &service )
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
foreach ( QString key, accountIds ) foreach ( QString key, accountIds )
{ {
tDebug() << "beginGroup" << QString( "accounts/%1" ).arg( key ); tDebug() << Q_FUNC_INFO << "beginGroup" << QString( "accounts/%1" ).arg( key );
TomahawkSettings::instance()->beginGroup( QString( "accounts/%1" ).arg( key ) ); TomahawkSettings::instance()->beginGroup( QString( "accounts/%1" ).arg( key ) );
const QVariantMap creds = TomahawkSettings::instance()->value( "credentials" ).toMap(); const QVariantMap creds = TomahawkSettings::instance()->value( "credentials" ).toMap();
tDebug() << creds[ "username" ] tDebug() << creds[ "username" ]
@@ -120,7 +120,7 @@ CredentialsManager::loadCredentials( const QString &service )
SLOT( keychainJobFinished( QKeychain::Job* ) ) ); SLOT( keychainJobFinished( QKeychain::Job* ) ) );
m_readJobs[ service ] << j; m_readJobs[ service ] << j;
j->start(); j->start();
tDebug() << "Launching QtKeychain readJob for" << key; tDebug() << Q_FUNC_INFO << "Launching QtKeychain readJob for" << key;
} }
if ( m_readJobs[ service ].isEmpty() ) if ( m_readJobs[ service ].isEmpty() )
@@ -171,7 +171,7 @@ CredentialsManager::credentials( const QString& serviceName, const QString& key
void void
CredentialsManager::setCredentials( const CredentialsStorageKey& csKey, const QVariant& value, bool tryToWriteAsString ) CredentialsManager::setCredentials( const CredentialsStorageKey& csKey, const QVariant& value, bool tryToWriteAsString )
{ {
tDebug() << Q_FUNC_INFO; // tDebug() << Q_FUNC_INFO;
QMutexLocker locker( &m_mutex ); QMutexLocker locker( &m_mutex );
QKeychain::Job* j; QKeychain::Job* j;
@@ -222,11 +222,11 @@ CredentialsManager::setCredentials( const CredentialsStorageKey& csKey, const QV
if ( ok ) if ( ok )
{ {
tDebug() << "About to write credentials for key" << csKey.key(); tDebug() << Q_FUNC_INFO << "About to write credentials for key" << csKey.key();
} }
else else
{ {
tDebug() << "Cannot serialize credentials for writing" << csKey.key(); tDebug() << Q_FUNC_INFO << "Cannot serialize credentials for writing" << csKey.key();
} }
wj->setTextData( data ); wj->setTextData( data );
@@ -267,12 +267,12 @@ void
CredentialsManager::keychainJobFinished( QKeychain::Job* j ) CredentialsManager::keychainJobFinished( QKeychain::Job* j )
{ {
#ifndef Q_OS_MAC #ifndef Q_OS_MAC
tDebug() << Q_FUNC_INFO; // tDebug() << Q_FUNC_INFO;
if ( QKeychain::ReadPasswordJob* readJob = qobject_cast< QKeychain::ReadPasswordJob* >( j ) ) if ( QKeychain::ReadPasswordJob* readJob = qobject_cast< QKeychain::ReadPasswordJob* >( j ) )
{ {
if ( readJob->error() == QKeychain::NoError ) if ( readJob->error() == QKeychain::NoError )
{ {
tDebug() << "QtKeychain readJob for" << readJob->service() << "/" tDebug() << Q_FUNC_INFO << "QtKeychain readJob for" << readJob->service() << "/"
<< readJob->key() << "finished without errors"; << readJob->key() << "finished without errors";
QVariant creds; QVariant creds;
@@ -292,7 +292,7 @@ CredentialsManager::keychainJobFinished( QKeychain::Job* j )
} }
else else
{ {
tDebug() << "QtKeychain readJob for" << readJob->service() << "/" << readJob->key() << "finished with ERROR:" << j->error() << j->errorString(); tDebug() << Q_FUNC_INFO << "QtKeychain readJob for" << readJob->service() << "/" << readJob->key() << "finished with ERROR:" << j->error() << j->errorString();
} }
m_readJobs[ readJob->service() ].removeOne( readJob ); m_readJobs[ readJob->service() ].removeOne( readJob );

View File

@@ -933,7 +933,7 @@ PlayableModel::startLoading()
Q_D( PlayableModel ); Q_D( PlayableModel );
if ( !d->loading ) if ( !d->loading )
{ {
tDebug() << Q_FUNC_INFO; // tDebug() << Q_FUNC_INFO;
d->loading = true; d->loading = true;
emit loadingStarted(); emit loadingStarted();
} }
@@ -1280,6 +1280,6 @@ PlayableModel::indexFromSource( const Tomahawk::source_ptr& source ) const
} }
} }
tDebug() << "Could not find item for source:" << source->friendlyName(); // tDebug() << "Could not find item for source:" << source->friendlyName();
return QModelIndex(); return QModelIndex();
} }

View File

@@ -52,7 +52,7 @@ QueueProxyModel::onIndexChanged( const QModelIndex& index )
PlayableItem* item = itemFromIndex( mapToSource( index ) ); PlayableItem* item = itemFromIndex( mapToSource( index ) );
if ( item && item->query() ) if ( item && item->query() )
{ {
tDebug() << item->query()->toString() << item->query()->resolvingFinished() << item->query()->playable(); // tDebug() << Q_FUNC_INFO << item->query()->toString() << item->query()->resolvingFinished() << item->query()->playable();
} }
if ( !item || !item->query() || ( item->query()->resolvingFinished() && !item->query()->playable() ) ) if ( !item || !item->query() || ( item->query()->resolvingFinished() && !item->query()->playable() ) )
{ {

View File

@@ -331,9 +331,9 @@ TreeModel::onTracksFound( const QList<Tomahawk::query_ptr>& tracks, Tomahawk::Mo
Tomahawk::Album* album = qobject_cast<Tomahawk::Album*>( sender() ); Tomahawk::Album* album = qobject_cast<Tomahawk::Album*>( sender() );
tDebug() << "Adding album:" << album->artist()->name() << album->name() << album->id(); tDebug() << Q_FUNC_INFO << "Adding album:" << album->artist()->name() << album->name() << album->id();
QModelIndex idx = indexFromAlbum( album->weakRef().toStrongRef() ); QModelIndex idx = indexFromAlbum( album->weakRef().toStrongRef() );
tDebug() << "Adding tracks" << tracks.count() << "to index:" << idx; tDebug() << Q_FUNC_INFO << "Adding tracks" << tracks.count() << "to index:" << idx;
onTracksAdded( tracks, idx ); onTracksAdded( tracks, idx );
} }
@@ -351,7 +351,7 @@ TreeModel::indexFromArtist( const Tomahawk::artist_ptr& artist ) const
} }
} }
tDebug() << "Could not find item for artist:" << artist->name(); tDebug() << Q_FUNC_INFO << "Could not find item for artist:" << artist->name();
return QModelIndex(); return QModelIndex();
} }
@@ -370,7 +370,7 @@ TreeModel::indexFromAlbum( const Tomahawk::album_ptr& album ) const
} }
} }
tDebug() << "Could not find item for album:" << album->name() << album->artist()->name(); tDebug() << Q_FUNC_INFO << "Could not find item for album:" << album->name() << album->artist()->name();
return QModelIndex(); return QModelIndex();
} }
@@ -383,14 +383,14 @@ TreeModel::indexFromResult( const Tomahawk::result_ptr& result ) const
{ {
QModelIndex idx = index( i, 0, albumIdx ); QModelIndex idx = index( i, 0, albumIdx );
PlayableItem* item = itemFromIndex( idx ); PlayableItem* item = itemFromIndex( idx );
tDebug() << item->result()->toString(); // tDebug() << Q_FUNC_INFO << item->result()->toString();
if ( item && item->result() == result ) if ( item && item->result() == result )
{ {
return idx; return idx;
} }
} }
tDebug() << "Could not find item for result:" << result->toString(); tDebug() << Q_FUNC_INFO << "Could not find item for result:" << result->toString();
return QModelIndex(); return QModelIndex();
} }
@@ -409,7 +409,7 @@ TreeModel::indexFromQuery( const Tomahawk::query_ptr& query ) const
} }
} }
tDebug() << "Could not find item for query:" << query->toString(); tDebug() << Q_FUNC_INFO << "Could not find item for query:" << query->toString();
return QModelIndex(); return QModelIndex();
} }
@@ -428,6 +428,6 @@ TreeModel::itemFromResult( const Tomahawk::result_ptr& result ) const
} }
} }
tDebug() << "Could not find item for result:" << result->toString(); tDebug() << Q_FUNC_INFO << "Could not find item for result:" << result->toString();
return 0; return 0;
} }

View File

@@ -145,7 +145,6 @@ ScriptResolver::sendConfig()
tDebug() << "Nam proxy is:" << Tomahawk::Utils::nam()->proxyFactory(); tDebug() << "Nam proxy is:" << Tomahawk::Utils::nam()->proxyFactory();
Tomahawk::Utils::nam()->proxyFactory()->queryProxy(); Tomahawk::Utils::nam()->proxyFactory()->queryProxy();
Tomahawk::Utils::NetworkProxyFactory* factory = dynamic_cast<Tomahawk::Utils::NetworkProxyFactory*>( Tomahawk::Utils::nam()->proxyFactory() ); Tomahawk::Utils::NetworkProxyFactory* factory = dynamic_cast<Tomahawk::Utils::NetworkProxyFactory*>( Tomahawk::Utils::nam()->proxyFactory() );
tDebug() << "Factory is:" << factory;
QNetworkProxy proxy = factory->proxy(); QNetworkProxy proxy = factory->proxy();
QString proxyType = ( proxy.type() == QNetworkProxy::Socks5Proxy ? "socks5" : "none" ); QString proxyType = ( proxy.type() == QNetworkProxy::Socks5Proxy ? "socks5" : "none" );
m.insert( "proxytype", proxyType ); m.insert( "proxytype", proxyType );

View File

@@ -344,7 +344,7 @@ PeerInfo::avatar( TomahawkUtils::ImageMode style, const QSize& size ) const
if ( d->avatar.isNull() ) if ( d->avatar.isNull() )
{ {
tDebug() << "Avatar for:" << id(); // tDebug() << "Avatar for:" << id();
Q_ASSERT( !contactId().isEmpty() ); Q_ASSERT( !contactId().isEmpty() );
if ( d->avatarBuffer.isEmpty() && !contactId().isEmpty() ) if ( d->avatarBuffer.isEmpty() && !contactId().isEmpty() )
d->avatarBuffer = TomahawkUtils::Cache::instance()->getData( "Sources", contactId() ).toByteArray(); d->avatarBuffer = TomahawkUtils::Cache::instance()->getData( "Sources", contactId() ).toByteArray();

View File

@@ -171,7 +171,7 @@ PluginLoader::pluginPaths( const QString& name ) const
QSet< QString > paths; QSet< QString > paths;
foreach ( const QDir& pluginDir, pluginDirs() ) foreach ( const QDir& pluginDir, pluginDirs() )
{ {
tDebug() << Q_FUNC_INFO << "Checking directory for" << type << "plugins:" << pluginDir; tDebug() << Q_FUNC_INFO << "Checking directory for" << type << "plugins:" << pluginDir.absolutePath();
foreach ( QString fileName, pluginDir.entryList( pluginFilenames( name ), QDir::Files ) ) foreach ( QString fileName, pluginDir.entryList( pluginFilenames( name ), QDir::Files ) )
{ {
//TODO: do we really need to check this?! //TODO: do we really need to check this?!

View File

@@ -200,7 +200,7 @@ AccountListWidget::removeEntries( const QModelIndex& parent, int start, int end
void void
AccountListWidget::toggleOnlineStateForAll() AccountListWidget::toggleOnlineStateForAll()
{ {
tDebug() << Q_FUNC_INFO; // tDebug() << Q_FUNC_INFO;
bool newState = !m_toggleOnlineButtonState; bool newState = !m_toggleOnlineButtonState;
foreach ( QList< AccountWidget* > awgts, m_entries ) foreach ( QList< AccountWidget* > awgts, m_entries )
{ {