From 1a0d338a789a66e9f3f933d0a4795b92d3111d5c Mon Sep 17 00:00:00 2001 From: Richard Frith-Macdonald Date: Sat, 21 Mar 2020 17:27:18 +0000 Subject: [PATCH] fixup logging on connect --- SQLClient.m | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/SQLClient.m b/SQLClient.m index df4bce7..b724445 100644 --- a/SQLClient.m +++ b/SQLClient.m @@ -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]; } } }