Browse Source

completely disable log file creation

miguelfreitas
Miguel Freitas 11 years ago
parent
commit
d1071c30f9
  1. 9
      libtorrent/include/libtorrent/debug.hpp

9
libtorrent/include/libtorrent/debug.hpp

@ -144,6 +144,7 @@ namespace libtorrent
logger(std::string const& logpath, std::string const& filename logger(std::string const& logpath, std::string const& filename
, int instance, bool append) , int instance, bool append)
{ {
/* [MF] log is now in bitcoin
char log_name[512]; char log_name[512];
snprintf(log_name, sizeof(log_name), "libtorrent_logs%d", instance); snprintf(log_name, sizeof(log_name), "libtorrent_logs%d", instance);
std::string dir(complete(combine_path(combine_path(logpath, log_name), filename)) + ".log"); std::string dir(complete(combine_path(combine_path(logpath, log_name), filename)) + ".log");
@ -151,15 +152,18 @@ namespace libtorrent
if (!exists(parent_path(dir))) if (!exists(parent_path(dir)))
create_directories(parent_path(dir), ec); create_directories(parent_path(dir), ec);
m_filename = dir; m_filename = dir;
*/
mutex::scoped_lock l(file_mutex); mutex::scoped_lock l(file_mutex);
open(!append); // [MF]
log_file << "\n\n\n*** starting log ***\n"; //open(!append);
//log_file << "\n\n\n*** starting log ***\n";
} }
void move_log_file(std::string const& logpath, std::string const& new_name, int instance) void move_log_file(std::string const& logpath, std::string const& new_name, int instance)
{ {
mutex::scoped_lock l(file_mutex); mutex::scoped_lock l(file_mutex);
/*
if (open_filename == m_filename) if (open_filename == m_filename)
{ {
log_file.close(); log_file.close();
@ -183,6 +187,7 @@ namespace libtorrent
, parent_path(dir).c_str(), ec.message().c_str()); , parent_path(dir).c_str(), ec.message().c_str());
m_filename = dir; m_filename = dir;
*/
} }
#if TORRENT_USE_IOSTREAM #if TORRENT_USE_IOSTREAM

Loading…
Cancel
Save