diff --git a/userspace/digwatch/configuration.cpp b/userspace/digwatch/configuration.cpp index 1835116f..401d6328 100644 --- a/userspace/digwatch/configuration.cpp +++ b/userspace/digwatch/configuration.cpp @@ -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("rules_file", "/etc/digwatch.conf"); diff --git a/userspace/digwatch/configuration.h b/userspace/digwatch/configuration.h index d709ffa5..9d3644ab 100644 --- a/userspace/digwatch/configuration.h +++ b/userspace/digwatch/configuration.h @@ -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;