fixup logging on connect

This commit is contained in:
Richard Frith-Macdonald 2020-03-21 17:27:18 +00:00
parent ca2f44a323
commit 1a0d338a78

View file

@ -2980,21 +2980,31 @@ static int poolConnections = 0;
if (_duration >= 0)
{
NSTimeInterval d;
NSString *s;
if (0 == _connectFails)
{
s = @"success";
d = _lastConnect - _lastStart;
}
else
{
s = @"failure";
d = _lastOperation - _lastStart;
}
d = _lastOperation - _lastStart;
if (d >= _duration)
{
if (_lastListen > 0.0)
{
[self debug: @"Duration %g for connection (%@)"
@", of which %g adding observers.",
d, (0 == _connectFails ? @"success" : @"failure"),
_lastOperation - _lastListen];
d, s, _lastOperation - _lastListen];
}
else
{
[self debug: @"Duration %g for connection (%@).",
d, (0 == _connectFails ? @"success" : @"failure")];
d, s];
}
}
}