Log if we don't update a service when switching from offline to online, otherwise...
[bpdyndnsd] / src / logger.cpp
index fda6f85..bce5a27 100644 (file)
@@ -1720,6 +1720,7 @@ void Logger::print_update_service_ttl_expired(const string& hostname, const stri
 
 /**
  * TTL expired
+ * @param override_log_level Override log level with zero if true
  * @param hostname Hostname
  * @param ip_dns_recheck Cached DNS entry
  * @param ip_last_update IP set in last update
@@ -1728,9 +1729,13 @@ void Logger::print_update_service_ttl_expired(const string& hostname, const stri
  * @param dns_cache_ttl DNS cache ttl
  * @param current_time Current time
  */
-void Logger::print_update_service_ttl_not_expired(const string& hostname, const string& ip_dns_recheck, const string& ip_last_update, const string& ip_host, const time_t lastupdated, const int dns_cache_ttl, const time_t current_time) const
+void Logger::print_update_service_ttl_not_expired(bool override_log_level, const string& hostname, const string& ip_dns_recheck, const string& ip_last_update, const string& ip_host, const time_t lastupdated, const int dns_cache_ttl, const time_t current_time) const
 {
     int level = 1;
+
+    if (override_log_level)
+        level = 0;
+
     if ( level <= Loglevel )
     {
         ostringstream msg;
@@ -1742,15 +1747,20 @@ void Logger::print_update_service_ttl_not_expired(const string& hostname, const
 
 /**
  * No update needed
+ * @param override_log_level Override log level with zero if true
  * @param hostname Hostname
  * @param ip_dns_recheck Cached DNS entry
  * @param ip_last_update IP set in last update
  * @param ip_host Hosts IP
  * @param lastupdated Last updated
  */
-void Logger::print_no_update_needed(const string& hostname, const string& ip_dns_recheck, const string& ip_last_update, const string& ip_host, const time_t lastupdated) const
+void Logger::print_no_update_needed(bool override_log_level, const string& hostname, const string& ip_dns_recheck, const string& ip_last_update, const string& ip_host, const time_t lastupdated) const
 {
     int level = 1;
+
+    if (override_log_level)
+        level = 0;
+
     if ( level <= Loglevel )
     {
         ostringstream msg;