From 639af87e53fafb8286e9cd8f4bc9b3780895dff7 Mon Sep 17 00:00:00 2001 From: rakshasa Date: Tue, 21 Feb 2012 15:37:50 +0900 Subject: [PATCH] Use new logging API. --- src/core/download_list.cc | 28 ++++++++++++++-------------- src/rpc/scgi_task.cc | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/core/download_list.cc b/src/core/download_list.cc index 6af7b19b..ebf4a6bf 100644 --- a/src/core/download_list.cc +++ b/src/core/download_list.cc @@ -178,7 +178,7 @@ DownloadList::iterator DownloadList::insert(Download* download) { iterator itr = base_type::insert(end(), download); - lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "->download_list: Inserting download."); + lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "download_list", "Inserting download."); try { (*itr)->data()->slot_initial_hash() = tr1::bind(&DownloadList::hash_done, this, download); @@ -210,7 +210,7 @@ DownloadList::erase(iterator itr) { if (itr == end()) throw torrent::internal_error("DownloadList::erase(...) could not find download."); - lt_log_print_info(torrent::LOG_TORRENT_INFO, (*itr)->info(), "->download_list: Erasing download."); + lt_log_print_info(torrent::LOG_TORRENT_INFO, (*itr)->info(), "download_list", "Erasing download."); // Makes sure close doesn't restart hashing of this download. (*itr)->set_hash_failed(true); @@ -246,7 +246,7 @@ void DownloadList::open_throw(Download* download) { check_contains(download); - lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "->download_list: Opening download."); + lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "download_list", "Opening download."); if (download->download()->info()->is_open()) return; @@ -272,7 +272,7 @@ DownloadList::close(Download* download) { void DownloadList::close_directly(Download* download) { - lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "->download_list: Closing download directly."); + lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "download_list", "Closing download directly."); if (download->download()->info()->is_active()) { download->download()->stop(torrent::Download::stop_skip_tracker); @@ -287,7 +287,7 @@ DownloadList::close_directly(Download* download) { void DownloadList::close_quick(Download* download) { - lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "->download_list: Closing download quickly."); + lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "download_list", "Closing download quickly."); close(download); // Make sure we cancel any tracker requests. This should rather be @@ -301,7 +301,7 @@ void DownloadList::close_throw(Download* download) { check_contains(download); - lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "->download_list: Closing download with throw."); + lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "download_list", "Closing download with throw."); // When pause gets called it will clear the initial hash check state // and set hash failed. This should ensure hashing doesn't restart @@ -334,7 +334,7 @@ void DownloadList::resume(Download* download, int flags) { check_contains(download); - lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "->download_list: Resuming download: flags:%0x.", flags); + lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "download_list", "Resuming download: flags:%0x.", flags); try { @@ -429,7 +429,7 @@ void DownloadList::pause(Download* download, int flags) { check_contains(download); - lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "->download_list: Pausing download: flags:%0x.", flags); + lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "download_list", "Pausing download: flags:%0x.", flags); try { @@ -478,7 +478,7 @@ void DownloadList::check_hash(Download* download) { check_contains(download); - lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "->download_list: Checking hash."); + lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "download_list", "Checking hash."); try { if (rpc::call_command_value("d.hashing", rpc::make_target(download)) != Download::variable_hashing_stopped) @@ -495,7 +495,7 @@ void DownloadList::hash_done(Download* download) { check_contains(download); - lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "->download_list: Hash done."); + lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "download_list", "Hash done."); if (download->is_hash_checking() || download->is_active()) throw torrent::internal_error("DownloadList::hash_done(...) download in invalid state."); @@ -571,7 +571,7 @@ void DownloadList::hash_queue(Download* download, int type) { check_contains(download); - lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "->download_list: Hash queue."); + lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "download_list", "Hash queue."); if (rpc::call_command_value("d.hashing", rpc::make_target(download)) != Download::variable_hashing_stopped) throw torrent::internal_error("DownloadList::hash_queue(...) hashing already queued."); @@ -602,7 +602,7 @@ void DownloadList::received_finished(Download* download) { check_contains(download); - lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "->download_list: Received finished."); + lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "download_list", "Received finished."); if (rpc::call_command_value("pieces.hash.on_completion")) // Set some 'checking_finished_thingie' variable to make hash_done @@ -617,7 +617,7 @@ void DownloadList::confirm_finished(Download* download) { check_contains(download); - lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "->download_list: Confirming finished."); + lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "download_list", "Confirming finished."); if (download->download()->info()->is_meta_download()) return process_meta_download(download); @@ -690,7 +690,7 @@ DownloadList::confirm_finished(Download* download) { void DownloadList::process_meta_download(Download* download) { - lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "->download_list: Processing meta download."); + lt_log_print_info(torrent::LOG_TORRENT_INFO, download->info(), "download_list", "Processing meta download."); rpc::call_command("d.stop", torrent::Object(), rpc::make_target(download)); rpc::call_command("d.close", torrent::Object(), rpc::make_target(download)); diff --git a/src/rpc/scgi_task.cc b/src/rpc/scgi_task.cc index 218c4ce0..16a7bb5b 100644 --- a/src/rpc/scgi_task.cc +++ b/src/rpc/scgi_task.cc @@ -185,7 +185,7 @@ SCgiTask::event_read() { result = write(m_parent->log_fd(), "\n---\n", sizeof("\n---\n")); } - lt_log_print_dump(torrent::LOG_RPC_DEBUG, m_body, m_bufferSize - std::distance(m_buffer, m_body), "SCGI RPC read.", 0); + lt_log_print_dump(torrent::LOG_RPC_DEBUG, m_body, m_bufferSize - std::distance(m_buffer, m_body), "scgi", "RPC read.", 0); // Close if the call failed, else stay open to write back data. if (!m_parent->receive_call(this, m_body, m_bufferSize - std::distance(m_buffer, m_body))) @@ -246,7 +246,7 @@ SCgiTask::receive_write(const char* buffer, uint32_t length) { result = write(m_parent->log_fd(), "\n---\n", sizeof("\n---\n")); } - lt_log_print_dump(torrent::LOG_RPC_DEBUG, m_buffer, m_bufferSize, "SCGI RPC write.", 0); + lt_log_print_dump(torrent::LOG_RPC_DEBUG, m_buffer, m_bufferSize, "scgi", "RPC write.", 0); event_write(); return true;