, ExternalWarningLevel(0)
, StartOffline(false)
, WebcheckEnabled(false)
+ , ExternalLogOnlyOnce(false)
{
// Available service description config options
po::options_description opt_desc_service("Service description options");
, ExternalWarningLevel(0)
, StartOffline(false)
, WebcheckEnabled(false)
+ , ExternalLogOnlyOnce(false)
{
// Available service description config options
po::options_description opt_desc_service("Service description options");
ExternalWarningLevel = VariablesMap["external_warning_level"].as<int>();
if ( VariablesMap.count("external_log_only_once") )
- StartOffline = VariablesMap["external_log_only_once"].as<bool>();
+ ExternalLogOnlyOnce = VariablesMap["external_log_only_once"].as<bool>();
if ( VariablesMap.count("start_offline") )
StartOffline = VariablesMap["start_offline"].as<bool>();
ExternalWarningLevel = VariablesMap["external_warning_level"].as<int>();
if ( VariablesMap.count("external_log_only_once") )
- StartOffline = VariablesMap["external_log_only_once"].as<bool>();
+ ExternalLogOnlyOnce = VariablesMap["external_log_only_once"].as<bool>();
if ( VariablesMap.count("start_offline") )
StartOffline = VariablesMap["start_offline"].as<bool>();
if ( level <= Loglevel )
{
ostringstream msg;
- msg << "Initialized logging facility." << " Loglevel: " << Loglevel << " Syslog: " << Syslog << endl;
+ msg << "Initialized logging facility." << " Loglevel: " << Loglevel << " Syslog: " << Syslog << " ExternalLogOnlyOnce: " << ExternalLogOnlyOnce << endl;
log_notice(msg.str());
}
}
log_error("Ignoring invalid service. Please check.\n");
}
}
+
+
+/**
+ * Print simple message.
+ */
+void Logger::print_msg( const string& msg ) const
+{
+ int level = 0;
+ if ( level <= Loglevel )
+ {
+ log_error(msg);
+ }
+}
void set_log_facility(const int _loglevel, const bool _syslog, const std::string& _external_error_log, const int _external_error_level, const bool _external_log_only_once );
+ bool is_allowed_to_send( const std::string& msg ) const;
+
+ // Start log messages.
+
void print_usage(const boost::shared_ptr<boost::program_options::options_description> opt_desc) const;
void print_version() const;
void print_invalid_service_config() const;
- bool is_allowed_to_send( const std::string& msg ) const;
+ void print_msg( const std::string& msg ) const;
};
#endif