Skip to content

Commit 9cc3971

Browse files
authored
Merge pull request #10352 from Icinga/checkable-checkercomponent-fixed-timestamp-debug-logs
Fixed double output for timestamps in debug log
2 parents 8d607d2 + 2ce34e8 commit 9cc3971

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/checker/checkercomponent.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ void CheckerComponent::CheckThreadProc()
199199
<< "Scheduling info for checkable '" << checkable->GetName() << "' ("
200200
<< Utility::FormatDateTime("%Y-%m-%d %H:%M:%S %z", checkable->GetNextCheck()) << "): Object '"
201201
<< csi.Object->GetName() << "', Next Check: "
202-
<< Utility::FormatDateTime("%Y-%m-%d %H:%M:%S %z", csi.NextCheck) << "(" << csi.NextCheck << ").";
202+
<< Utility::FormatDateTime("%Y-%m-%d %H:%M:%S %z", csi.NextCheck)
203+
<< " (" << std::fixed << std::setprecision(0) << csi.NextCheck << ").";
203204

204205
m_PendingCheckables.insert(csi);
205206

lib/icinga/checkable-check.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,11 @@ void Checkable::UpdateNextCheck(const MessageOrigin::Ptr& origin)
7171
double lastCheck = GetLastCheck();
7272

7373
Log(LogDebug, "Checkable")
74+
<< std::fixed << std::setprecision(0)
7475
<< "Update checkable '" << GetName() << "' with check interval '" << GetCheckInterval()
7576
<< "' from last check time at " << Utility::FormatDateTime("%Y-%m-%d %H:%M:%S %z", (lastCheck < 0 ? 0 : lastCheck))
76-
<< " (" << GetLastCheck() << ") to next check time at " << Utility::FormatDateTime("%Y-%m-%d %H:%M:%S %z", nextCheck) << " (" << nextCheck << ").";
77+
<< " (" << lastCheck << ") to next check time at "
78+
<< Utility::FormatDateTime("%Y-%m-%d %H:%M:%S %z", nextCheck) << " (" << nextCheck << ").";
7779

7880
SetNextCheck(nextCheck, false, origin);
7981
}

0 commit comments

Comments
 (0)