Remove double whitespaces for notifications log message 7192/head
authorAlexander Stoll <astoll@netways.de>
Wed, 22 May 2019 12:13:14 +0000 (14:13 +0200)
committerAlexander Stoll <astoll@netways.de>
Wed, 22 May 2019 12:13:14 +0000 (14:13 +0200)
Add space to checkable debug message to unify timestamp format

lib/icinga/checkable-check.cpp
lib/icinga/notification.cpp

index 8feeaceb091ca102b21850ceabfcf2f0f5d10d5b..cab1557eaca319af7ed514160c733c24d720e168 100644 (file)
@@ -71,7 +71,7 @@ void Checkable::UpdateNextCheck(const MessageOrigin::Ptr& origin)
        Log(LogDebug, "Checkable")
                << "Update checkable '" << GetName() << "' with check interval '" << GetCheckInterval()
                << "' from last check time at " << Utility::FormatDateTime("%Y-%m-%d %H:%M:%S %z", (lastCheck < 0 ? 0 : lastCheck))
-               << " (" << GetLastCheck() << ") to next check time at " << Utility::FormatDateTime("%Y-%m-%d %H:%M:%S %z", nextCheck) << "(" << nextCheck << ").";
+               << " (" << GetLastCheck() << ") to next check time at " << Utility::FormatDateTime("%Y-%m-%d %H:%M:%S %z", nextCheck) << " (" << nextCheck << ").";
 
        SetNextCheck(nextCheck, false, origin);
 }
index 5067116a9627722f5d9d0c9b5af60c182919c45e..d8996fdda8866a31158f3f35739e7b8df26ce403 100644 (file)
@@ -247,7 +247,7 @@ void Notification::BeginExecuteNotification(NotificationType type, const CheckRe
        String notificationName = GetName();
 
        Log(LogNotice, "Notification")
-               << "Attempting to send " << (reminder ? "reminder " : " ") << "notifications for notification object '" << notificationName << "'.";
+               << "Attempting to send " << (reminder ? "reminder " : "") << "notifications for notification object '" << notificationName << "'.";
 
        Checkable::Ptr checkable = GetCheckable();
 
@@ -256,7 +256,7 @@ void Notification::BeginExecuteNotification(NotificationType type, const CheckRe
 
                if (tp && !tp->IsInside(Utility::GetTime())) {
                        Log(LogNotice, "Notification")
-                               << "Not sending " << (reminder ? "reminder " : " ") << "notifications for notification object '" << notificationName
+                               << "Not sending " << (reminder ? "reminder " : "") << "notifications for notification object '" << notificationName
                                << "': not in timeperiod '" << tp->GetName() << "'";
                        return;
                }
@@ -270,7 +270,7 @@ void Notification::BeginExecuteNotification(NotificationType type, const CheckRe
 
                        if (timesBegin != Empty && timesBegin >= 0 && now < checkable->GetLastHardStateChange() + timesBegin) {
                                Log(LogNotice, "Notification")
-                                       << "Not sending " << (reminder ? "reminder " : " ") << "notifications for notification object '"
+                                       << "Not sending " << (reminder ? "reminder " : "") << "notifications for notification object '"
                                        << notificationName << "': before specified begin time (" << Utility::FormatDuration(timesBegin) << ")";
 
                                /* we need to adjust the next notification time
@@ -283,7 +283,7 @@ void Notification::BeginExecuteNotification(NotificationType type, const CheckRe
 
                        if (timesEnd != Empty && timesEnd >= 0 && now > checkable->GetLastHardStateChange() + timesEnd) {
                                Log(LogNotice, "Notification")
-                                       << "Not sending " << (reminder ? "reminder " : " ") << "notifications for notification object '"
+                                       << "Not sending " << (reminder ? "reminder " : "") << "notifications for notification object '"
                                        << notificationName << "': after specified end time (" << Utility::FormatDuration(timesEnd) << ")";
                                return;
                        }
@@ -298,7 +298,7 @@ void Notification::BeginExecuteNotification(NotificationType type, const CheckRe
 
                if (!(ftype & GetTypeFilter())) {
                        Log(LogNotice, "Notification")
-                               << "Not sending " << (reminder ? "reminder " : " ") << "notifications for notification object '"
+                               << "Not sending " << (reminder ? "reminder " : "") << "notifications for notification object '"
                                << notificationName << "': type '"
                                << NotificationTypeToStringInternal(type) << "' does not match type filter: "
                                << NotificationFilterToString(GetTypeFilter(), GetTypeFilterMap()) << ".";
@@ -338,7 +338,7 @@ void Notification::BeginExecuteNotification(NotificationType type, const CheckRe
 
                        if (!(fstate & GetStateFilter())) {
                                Log(LogNotice, "Notification")
-                                       << "Not sending " << (reminder ? "reminder " : " ") << "notifications for notification object '"
+                                       << "Not sending " << (reminder ? "reminder " : "") << "notifications for notification object '"
                                        << notificationName << "': state '" << stateStr
                                        << "' does not match state filter: " << NotificationFilterToString(GetStateFilter(), GetStateFilterMap()) << ".";
                                return;
@@ -346,7 +346,7 @@ void Notification::BeginExecuteNotification(NotificationType type, const CheckRe
                }
        } else {
                Log(LogNotice, "Notification")
-                       << "Not checking " << (reminder ? "reminder " : " ") << "notification filters for notification object '"
+                       << "Not checking " << (reminder ? "reminder " : "") << "notification filters for notification object '"
                        << notificationName << "': Notification was forced.";
        }
 
@@ -450,7 +450,7 @@ bool Notification::CheckNotificationUserFilters(NotificationType type, const Use
 
                if (tp && !tp->IsInside(Utility::GetTime())) {
                        Log(LogNotice, "Notification")
-                               << "Not sending " << (reminder ? "reminder " : " ") << "notifications for notification object '"
+                               << "Not sending " << (reminder ? "reminder " : "") << "notifications for notification object '"
                                << notificationName << " and user '" << userName
                                << "': user period not in timeperiod '" << tp->GetName() << "'";
                        return false;
@@ -467,7 +467,7 @@ bool Notification::CheckNotificationUserFilters(NotificationType type, const Use
 
                if (!(ftype & user->GetTypeFilter())) {
                        Log(LogNotice, "Notification")
-                               << "Not sending " << (reminder ? "reminder " : " ") << "notifications for notification object '"
+                               << "Not sending " << (reminder ? "reminder " : "") << "notifications for notification object '"
                                << notificationName << " and user '" << userName << "': type '"
                                << NotificationTypeToStringInternal(type) << "' does not match type filter: "
                                << NotificationFilterToString(user->GetTypeFilter(), GetTypeFilterMap()) << ".";
@@ -500,7 +500,7 @@ bool Notification::CheckNotificationUserFilters(NotificationType type, const Use
 
                        if (!(fstate & user->GetStateFilter())) {
                                Log(LogNotice, "Notification")
-                                       << "Not " << (reminder ? "reminder " : " ") << "sending notifications for notification object '"
+                                       << "Not " << (reminder ? "reminder " : "") << "sending notifications for notification object '"
                                        << notificationName << " and user '" << userName << "': state '" << stateStr
                                        << "' does not match state filter: " << NotificationFilterToString(user->GetStateFilter(), GetStateFilterMap()) << ".";
                                return false;
@@ -508,7 +508,7 @@ bool Notification::CheckNotificationUserFilters(NotificationType type, const Use
                }
        } else {
                Log(LogNotice, "Notification")
-                       << "Not checking " << (reminder ? "reminder " : " ") << "notification filters for notification object '"
+                       << "Not checking " << (reminder ? "reminder " : "") << "notification filters for notification object '"
                        << notificationName << "' and user '" << userName << "': Notification was forced.";
        }