From 80aa549259405f91afa9492bd7db19938c711083 Mon Sep 17 00:00:00 2001 From: Qi Ma Date: Wed, 13 Aug 2014 17:23:38 +0100 Subject: [PATCH] move server name/port/dir from InitialiseVLOG to visuliaser's initial list --- include/maidsafe/common/log.h | 8 +++----- src/maidsafe/common/log.cc | 10 +++------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/include/maidsafe/common/log.h b/include/maidsafe/common/log.h index 772bef91..95a5bb43 100644 --- a/include/maidsafe/common/log.h +++ b/include/maidsafe/common/log.h @@ -136,9 +136,7 @@ class Logging { // Returns unused options template std::vector> Initialise(int argc, Char** argv); - void InitialiseVlog(const std::string& prefix, const std::string& session_id, - const std::string& server_name, uint16_t server_port, - const std::string& server_dir); + void InitialiseVlog(const std::string& prefix, const std::string& session_id); void Send(std::function message_functor); void WriteToCombinedLogfile(const std::string& message); void WriteToVisualiserLogfile(const std::string& message); @@ -162,8 +160,8 @@ class Logging { }; struct Visualiser { Visualiser() : prefix("Vault ID uninitialised"), session_id(), logfile(), server_stream(), - server_name(), server_dir(), server_port(0), initialised(false), - initialised_once_flag() {} + server_name("visualiser.maidsafe.net"), server_dir("/log"), server_port(8080), + initialised(false), initialised_once_flag() {} std::string prefix, session_id; LogFile logfile; boost::asio::ip::tcp::iostream server_stream; diff --git a/src/maidsafe/common/log.cc b/src/maidsafe/common/log.cc index 2733fec3..4fb96b35 100644 --- a/src/maidsafe/common/log.cc +++ b/src/maidsafe/common/log.cc @@ -531,9 +531,7 @@ std::vector> Logging::Initialise(int argc, wchar_t** argv) return unused_options; } -void Logging::InitialiseVlog(const std::string& prefix, const std::string& session_id, - const std::string& server_name, uint16_t server_port, - const std::string& server_dir) { +void Logging::InitialiseVlog(const std::string& prefix, const std::string& session_id) { if (visualiser_.initialised) BOOST_THROW_EXCEPTION(MakeError(CommonErrors::already_initialised)); std::call_once(visualiser_.initialised_once_flag, [&] { @@ -543,10 +541,8 @@ void Logging::InitialiseVlog(const std::string& prefix, const std::string& sessi if (visualiser_.session_id.empty()) LOG(kWarning) << "VLOG messages disabled since Vlog Session ID is empty."; visualiser_.logfile.stream.open(GetLogfileName("visualiser").c_str(), std::ios_base::trunc); - visualiser_.server_name = server_name; - visualiser_.server_port = server_port; - visualiser_.server_dir = server_dir; - visualiser_.server_stream.connect(server_name, std::to_string(server_port)); + visualiser_.server_stream.connect(visualiser_.server_name, + std::to_string(visualiser_.server_port)); if (!visualiser_.server_stream) { LOG(kError) << "Failed to connect to VLOG server: " << visualiser_.server_stream.error().message();