diff --git a/garb/garb_config.cpp b/garb/garb_config.cpp index dd995d8f7..1875bda42 100644 --- a/garb/garb_config.cpp +++ b/garb/garb_config.cpp @@ -49,6 +49,7 @@ Config::Config (int argc, char* argv[]) #if defined(WITH_COREDUMPER) && WITH_COREDUMPER coredumper_ (), #endif + debug_ (false), exit_ (false) { po::options_description other ("Other options"); @@ -72,8 +73,8 @@ Config::Config (int argc, char* argv[]) ("options,o", po::value(&options_), "GCS/GCOMM option list") ("log,l", po::value(&log_), "Log file") ("recv-script", po::value(&recv_script_), "SST request receive script") - ("workdir,w",po::value(&workdir_), - "Daemon working directory") + ("workdir,w", po::value(&workdir_), "Daemon working directory") + ("debug", po::value(&debug_), "Enable debug prints") ; po::options_description cfg_opt; @@ -128,6 +129,12 @@ Config::Config (int argc, char* argv[]) notify(vm); } + if (vm.count("debug")) + { + if (debug_) + gu_conf_debug_on(); + } + if (!vm.count("address")) { gu_throw_error(EDESTADDRREQ) << "Group address not specified"; @@ -207,7 +214,8 @@ std::ostream& operator << (std::ostream& os, const Config& c) << "\n\tcfg: " << c.cfg() << "\n\tlog: " << c.log() << "\n\trecv_script: " << c.recv_script() - << "\n\tworkdir: " << c.workdir(); + << "\n\tworkdir: " << c.workdir() + << "\n\tdebug: " << c.debug();; return os; } diff --git a/garb/garb_config.hpp b/garb/garb_config.hpp index 3372a0636..c3956638c 100644 --- a/garb/garb_config.hpp +++ b/garb/garb_config.hpp @@ -32,6 +32,7 @@ class Config const std::string& coredumper() const { return coredumper_; } #endif bool exit() const { return exit_ ; } + bool debug() const { return debug_ ; } const std::string& recv_script() const { return recv_script_ ; } private: @@ -50,6 +51,7 @@ class Config #if defined(WITH_COREDUMPER) && WITH_COREDUMPER std::string coredumper_; #endif + bool debug_; bool exit_; /* Exit on --help or --version */ }; /* class Config */