diff options
author | Marc Laukien <marc@zeroc.com> | 2002-02-10 12:52:13 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2002-02-10 12:52:13 +0000 |
commit | 44ecadaa1264fcc3d5eb9390da499d18cf3056cf (patch) | |
tree | 83ba8979ed4866e864e5f2e95fb3cf176e2b8b58 /cpp/src/Ice/ConnectionFactory.cpp | |
parent | fix (diff) | |
download | ice-44ecadaa1264fcc3d5eb9390da499d18cf3056cf.tar.bz2 ice-44ecadaa1264fcc3d5eb9390da499d18cf3056cf.tar.xz ice-44ecadaa1264fcc3d5eb9390da499d18cf3056cf.zip |
LoggerUtil
Diffstat (limited to 'cpp/src/Ice/ConnectionFactory.cpp')
-rw-r--r-- | cpp/src/Ice/ConnectionFactory.cpp | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/cpp/src/Ice/ConnectionFactory.cpp b/cpp/src/Ice/ConnectionFactory.cpp index af476071952..0191bf718ef 100644 --- a/cpp/src/Ice/ConnectionFactory.cpp +++ b/cpp/src/Ice/ConnectionFactory.cpp @@ -11,7 +11,7 @@ #include <Ice/ConnectionFactory.h> #include <Ice/Connection.h> #include <Ice/Instance.h> -#include <Ice/Logger.h> +#include <Ice/LoggerUtil.h> #include <Ice/TraceLevels.h> #include <Ice/Properties.h> #include <Ice/Transceiver.h> @@ -124,18 +124,17 @@ IceInternal::OutgoingConnectionFactory::create(const vector<EndpointPtr>& endpoi if (traceLevels->retry >= 2) { - ostringstream s; - s << "connection to endpoint failed"; + Trace out(logger, traceLevels->retryCat); + out << "connection to endpoint failed"; if (q != endpoints.end()) { - s << ", trying next endpoint\n"; + out << ", trying next endpoint\n"; } else { - s << " and no more endpoints to try\n"; + out << " and no more endpoints to try\n"; } - s << *exception.get(); - logger->trace(traceLevels->retryCat, s.str()); + out << *exception.get(); } } @@ -332,13 +331,11 @@ IceInternal::IncomingConnectionFactory::message(BasicStream&) { // TODO: bandaid. Takes care of SSL Handshake problems during // creation of a Transceiver. Ignore, nothing we can do here. - warning(ex); } catch (const SocketException& ex) { // TODO: bandaid. Takes care of SSL Handshake problems during // creation of a Transceiver. Ignore, nothing we can do here. - warning(ex); } catch (const TimeoutException&) { @@ -346,7 +343,11 @@ IceInternal::IncomingConnectionFactory::message(BasicStream&) } catch (const LocalException& ex) { - warning(ex); + if (_warn) + { + Warning out(_instance->logger()); + out << "connection exception:\n" << ex << '\n' << _acceptor->toString(); + } setState(StateClosed); } @@ -519,14 +520,3 @@ IceInternal::IncomingConnectionFactory::clearBacklog() } } } - -void -IceInternal::IncomingConnectionFactory::warning(const LocalException& ex) const -{ - if (_warn) - { - ostringstream s; - s << "connection exception:\n" << ex << '\n' << _acceptor->toString(); - _instance->logger()->warning(s.str()); - } -} |