From 5bf7bd3ba234b851d7563bbcb799f748ee4dfc47 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 19 Dec 2018 11:24:31 -0800 Subject: SERVER-37722 Check for quiet flag when logging connection end message --- src/mongo/transport/service_entry_point_impl.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mongo/transport/service_entry_point_impl.cpp b/src/mongo/transport/service_entry_point_impl.cpp index 2dc1562ffdb..a988293b0ea 100644 --- a/src/mongo/transport/service_entry_point_impl.cpp +++ b/src/mongo/transport/service_entry_point_impl.cpp @@ -169,7 +169,7 @@ void ServiceEntryPointImpl::startSession(transport::SessionHandle session) { << connectionCount << word << " now open)"; } - ssm->setCleanupHook([ this, ssmIt, session = std::move(session) ] { + ssm->setCleanupHook([ this, ssmIt, quiet, session = std::move(session) ] { size_t connectionCount; auto remote = session->remote(); { @@ -179,9 +179,11 @@ void ServiceEntryPointImpl::startSession(transport::SessionHandle session) { _currentConnections.store(connectionCount); } _shutdownCondition.notify_one(); - const auto word = (connectionCount == 1 ? " connection"_sd : " connections"_sd); - log() << "end connection " << remote << " (" << connectionCount << word << " now open)"; + if (!quiet) { + const auto word = (connectionCount == 1 ? " connection"_sd : " connections"_sd); + log() << "end connection " << remote << " (" << connectionCount << word << " now open)"; + } }); auto ownership = ServiceStateMachine::Ownership::kOwned; -- cgit v1.2.1