Add a configuration::init() that just sets up defaults

(For when no config file is being used)
This commit is contained in:
Henri DF 2016-04-12 16:00:56 -07:00
parent dc099bfb91
commit 73ec593931
2 changed files with 11 additions and 1 deletions

View File

@ -4,9 +4,18 @@
using namespace std;
// If we don't have a configuration file, we just use stdout output and all other defaults
void digwatch_configuration::init()
{
string m_config_file = DIGWATCH_CONF_FILE;
output_config stdout_output;
stdout_output.name = "stdout";
m_outputs.push_back(stdout_output);
}
void digwatch_configuration::init(string conf_filename)
{
string m_config_file = conf_filename;
m_config = new yaml_configuration(m_config_file);
m_rules_file = m_config->get_scalar<string>("rules_file", "/etc/digwatch.conf");

View File

@ -92,6 +92,7 @@ private:
class digwatch_configuration
{
public:
void init(std::string conf_filename);
void init();
std::string m_rules_file;
std::string m_priority_level;