Browse Source

Use the actual function names for debug logging.

adaptive-webui-19844
sledgehammer999 9 years ago
parent
commit
cc9ffc4767
  1. 10
      src/core/bittorrent/session.cpp
  2. 18
      src/core/bittorrent/torrenthandle.cpp
  3. 4
      src/gui/mainwindow.cpp

10
src/core/bittorrent/session.cpp

@ -2092,7 +2092,7 @@ void Session::handleAlert(libt::alert *a) @@ -2092,7 +2092,7 @@ void Session::handleAlert(libt::alert *a)
}
}
catch (std::exception &exc) {
qWarning() << "Caught exception in readAlerts(): " << Utils::String::fromStdString(exc.what());
qWarning() << "Caught exception in " << Q_FUNC_INFO << ": " << Utils::String::fromStdString(exc.what());
}
}
@ -2411,7 +2411,7 @@ void torrentQueuePositionUp(const libt::torrent_handle &handle) @@ -2411,7 +2411,7 @@ void torrentQueuePositionUp(const libt::torrent_handle &handle)
handle.queue_position_up();
}
catch (std::exception &exc) {
qDebug() << "torrent_handle::queue_position_up() fails:" << exc.what();
qDebug() << Q_FUNC_INFO << " fails: " << exc.what();
}
}
@ -2421,7 +2421,7 @@ void torrentQueuePositionDown(const libt::torrent_handle &handle) @@ -2421,7 +2421,7 @@ void torrentQueuePositionDown(const libt::torrent_handle &handle)
handle.queue_position_down();
}
catch (std::exception &exc) {
qDebug() << "torrent_handle::queue_position_down() fails:" << exc.what();
qDebug() << Q_FUNC_INFO << " fails: " << exc.what();
}
}
@ -2431,7 +2431,7 @@ void torrentQueuePositionTop(const libt::torrent_handle &handle) @@ -2431,7 +2431,7 @@ void torrentQueuePositionTop(const libt::torrent_handle &handle)
handle.queue_position_top();
}
catch (std::exception &exc) {
qDebug() << "torrent_handle::queue_position_top() fails:" << exc.what();
qDebug() << Q_FUNC_INFO << " fails: " << exc.what();
}
}
@ -2441,6 +2441,6 @@ void torrentQueuePositionBottom(const libt::torrent_handle &handle) @@ -2441,6 +2441,6 @@ void torrentQueuePositionBottom(const libt::torrent_handle &handle)
handle.queue_position_bottom();
}
catch (std::exception &exc) {
qDebug() << "torrent_handle::queue_position_bottom() fails:" << exc.what();
qDebug() << Q_FUNC_INFO << " fails: " << exc.what();
}
}

18
src/core/bittorrent/torrenthandle.cpp

@ -148,7 +148,7 @@ AddTorrentData::AddTorrentData(const AddTorrentParams &in) @@ -148,7 +148,7 @@ AddTorrentData::AddTorrentData(const AddTorrentParams &in)
m_nativeHandle.func(__VA_ARGS__); \
} \
catch (std::exception &exc) { \
qDebug("torrent_handle::"#func"() throws exception: %s", exc.what()); \
qDebug() << Q_FUNC_INFO << " throws exception: " << exc.what(); \
}
#define SAFE_CALL_BOOL(func, ...) \
@ -157,7 +157,7 @@ AddTorrentData::AddTorrentData(const AddTorrentParams &in) @@ -157,7 +157,7 @@ AddTorrentData::AddTorrentData(const AddTorrentParams &in)
return true; \
} \
catch (std::exception &exc) { \
qDebug("torrent_handle::"#func"() throws exception: %s", exc.what()); \
qDebug() << Q_FUNC_INFO << " throws exception: " << exc.what(); \
return false; \
}
@ -167,7 +167,7 @@ AddTorrentData::AddTorrentData(const AddTorrentParams &in) @@ -167,7 +167,7 @@ AddTorrentData::AddTorrentData(const AddTorrentParams &in)
result = m_nativeHandle.func(); \
} \
catch (std::exception &exc) { \
qDebug("torrent_handle::"#func"() throws exception: %s", exc.what()); \
qDebug() << Q_FUNC_INFO << " throws exception: " << exc.what(); \
} \
return result;
@ -176,7 +176,7 @@ AddTorrentData::AddTorrentData(const AddTorrentParams &in) @@ -176,7 +176,7 @@ AddTorrentData::AddTorrentData(const AddTorrentParams &in)
var = m_nativeHandle.func(__VA_ARGS__); \
} \
catch (std::exception &exc) { \
qDebug("torrent_handle::"#func"() throws exception: %s", exc.what()); \
qDebug() << Q_FUNC_INFO << " throws exception: " << exc.what(); \
}
const qreal TorrentHandle::USE_GLOBAL_RATIO = -2.;
@ -1186,7 +1186,7 @@ void TorrentHandle::pause() @@ -1186,7 +1186,7 @@ void TorrentHandle::pause()
m_nativeHandle.pause();
}
catch (std::exception &exc) {
qDebug("torrent_handle method inside TorrentHandleImpl::pause() throws exception: %s", exc.what());
qDebug() << Q_FUNC_INFO << " throws exception: " << exc.what();
}
}
@ -1201,7 +1201,7 @@ void TorrentHandle::resume(bool forced) @@ -1201,7 +1201,7 @@ void TorrentHandle::resume(bool forced)
m_nativeHandle.resume();
}
catch (std::exception &exc) {
qDebug("torrent_handle method inside TorrentHandleImpl::resume() throws exception: %s", exc.what());
qDebug() << Q_FUNC_INFO << " throws exception: " << exc.what();
}
}
@ -1279,13 +1279,13 @@ void TorrentHandle::handleStateUpdate(const libt::torrent_status &nativeStatus) @@ -1279,13 +1279,13 @@ void TorrentHandle::handleStateUpdate(const libt::torrent_status &nativeStatus)
void TorrentHandle::handleStorageMovedAlert(libtorrent::storage_moved_alert *p)
{
if (!isMoveInProgress()) {
qWarning("Unexpected TorrentHandleImpl::handleStorageMoved() call.");
qWarning() << "Unexpected " << Q_FUNC_INFO << " call.";
return;
}
QString newPath = Utils::String::fromStdString(p->path);
if (newPath != m_newPath) {
qWarning("TorrentHandleImpl::handleStorageMoved(): New path doesn't match a path in a queue.");
qWarning() << Q_FUNC_INFO << ": New path doesn't match a path in a queue.";
return;
}
@ -1317,7 +1317,7 @@ void TorrentHandle::handleStorageMovedAlert(libtorrent::storage_moved_alert *p) @@ -1317,7 +1317,7 @@ void TorrentHandle::handleStorageMovedAlert(libtorrent::storage_moved_alert *p)
void TorrentHandle::handleStorageMovedFailedAlert(libtorrent::storage_moved_failed_alert *p)
{
if (!isMoveInProgress()) {
qWarning("Unexpected TorrentHandleImpl::handleStorageMovedFailed() call.");
qWarning() << "Unexpected " << Q_FUNC_INFO << " call.";
return;
}

4
src/gui/mainwindow.cpp

@ -721,7 +721,7 @@ void MainWindow::handleDownloadFromUrlFailure(QString url, QString reason) const @@ -721,7 +721,7 @@ void MainWindow::handleDownloadFromUrlFailure(QString url, QString reason) const
void MainWindow::on_actionSet_global_upload_limit_triggered()
{
qDebug("actionSet_global_upload_limit_triggered");
qDebug() << Q_FUNC_INFO;
bool ok;
int cur_limit = BitTorrent::Session::instance()->uploadRateLimit();
const long new_limit = SpeedLimitDialog::askSpeedLimit(&ok, tr("Global Upload Speed Limit"), cur_limit);
@ -737,7 +737,7 @@ void MainWindow::on_actionSet_global_upload_limit_triggered() @@ -737,7 +737,7 @@ void MainWindow::on_actionSet_global_upload_limit_triggered()
void MainWindow::on_actionSet_global_download_limit_triggered()
{
qDebug("actionSet_global_download_limit_triggered");
qDebug() << Q_FUNC_INFO;
bool ok;
int cur_limit = BitTorrent::Session::instance()->downloadRateLimit();
const long new_limit = SpeedLimitDialog::askSpeedLimit(&ok, tr("Global Download Speed Limit"), cur_limit);

Loading…
Cancel
Save