diff --git a/src/logging.cpp b/src/logging.cpp index bb49555..384154a 100644 --- a/src/logging.cpp +++ b/src/logging.cpp @@ -22,8 +22,6 @@ namespace UDPT { Logger::Logger(Settings *s, ostream &os) : logfile (os) { - this->max_time = 120; - this->queue_limit = 50; } void Logger::log(enum LogLevel lvl, string msg) diff --git a/src/logging.h b/src/logging.h index b366592..fe9362d 100644 --- a/src/logging.h +++ b/src/logging.h @@ -43,8 +43,6 @@ namespace UDPT { void log (enum LogLevel, string msg); private: ostream &logfile; - unsigned int queue_limit; - int max_time; }; }; diff --git a/src/udpTracker.cpp b/src/udpTracker.cpp index 3b860bb..c775afb 100644 --- a/src/udpTracker.cpp +++ b/src/udpTracker.cpp @@ -85,7 +85,9 @@ namespace UDPT pthread_detach (this->threads[i]); pthread_cancel (this->threads[i]); #endif - cout << "Thread (" << ( i + 1) << "/" << ((int)this->thread_count) << ") terminated." << endl; + stringstream str; + str << "Thread (" << (i + 1) << "/" << ((int)this->thread_count) << ") terminated."; + logger->log(Logger::LL_INFO, str.str()); } if (this->conn != NULL) delete this->conn; @@ -334,7 +336,6 @@ namespace UDPT i, // loop counter j; // loop counter uint8_t hash [20]; - char xHash [50]; ScrapeResponse *resp; uint8_t buffer [1024]; // up to 74 torrents can be scraped at once (17*74+8) < 1024 @@ -372,10 +373,6 @@ namespace UDPT for (j = 0; j < 20;j++) hash[j] = data[j + (i*20)+16]; - to_hex_str (hash, xHash); - - cout << "\t" << xHash << endl; - seeders = (int32_t*)&buffer[i*12+8]; completed = (int32_t*)&buffer[i*12+12]; leechers = (int32_t*)&buffer[i*12+16]; @@ -392,7 +389,6 @@ namespace UDPT *completed = m_hton32 (tE.completed); *leechers = m_hton32 (tE.leechers); } - cout.flush(); sendto (usi->sock, (const char*)buffer, sizeof(buffer), 0, (SOCKADDR*)remote, sizeof(SOCKADDR_IN));