Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PXC-3423: Introduce a garbd variable to enable logging of debugging information to the error log #250

Open
wants to merge 2 commits into
base: 4.x-8.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions garb/garb_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -72,8 +73,8 @@ Config::Config (int argc, char* argv[])
("options,o", po::value<std::string>(&options_), "GCS/GCOMM option list")
("log,l", po::value<std::string>(&log_), "Log file")
("recv-script", po::value<std::string>(&recv_script_), "SST request receive script")
("workdir,w",po::value<std::string>(&workdir_),
"Daemon working directory")
("workdir,w", po::value<std::string>(&workdir_), "Daemon working directory")
("debug", po::value<bool>(&debug_), "Enable debug prints")
;

po::options_description cfg_opt;
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 2 additions & 0 deletions garb/garb_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 */
Expand Down