From c04572f68555f6df73cb6945550e8870dd184657 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Tue, 16 Jun 2015 11:17:39 +0200 Subject: [PATCH] Removed logs from controller config file. --- src/controller/controller.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/controller/controller.cpp b/src/controller/controller.cpp index 593692d0..72dff86d 100644 --- a/src/controller/controller.cpp +++ b/src/controller/controller.cpp @@ -307,13 +307,13 @@ int main(int argc, char ** argv){ //close stderr to make the stderr reading thread exit close(STDERR_FILENO); //write config + tthread::lock_guard guard(Controller::logMutex); + Controller::Storage.removeMember("log"); + for (JSON::ObjIter it = Controller::Storage["streams"].ObjBegin(); it != Controller::Storage["streams"].ObjEnd(); it++){ + it->second.removeMember("meta"); + } if ( !Controller::WriteFile(Controller::conf.getString("configFile"), Controller::Storage.toString())){ std::cerr << "Error writing config " << Controller::conf.getString("configFile") << std::endl; - tthread::lock_guard guard(Controller::logMutex); - Controller::Storage.removeMember("log"); - for (JSON::ObjIter it = Controller::Storage["streams"].ObjBegin(); it != Controller::Storage["streams"].ObjEnd(); it++){ - it->second.removeMember("meta"); - } std::cerr << "**Config**" << std::endl; std::cerr << Controller::Storage.toString() << std::endl; std::cerr << "**End config**" << std::endl; @@ -330,3 +330,4 @@ int main(int argc, char ** argv){ /*LTS-END*/ return 0; } +