diff options
author | Marc Laukien <marc@zeroc.com> | 2001-12-01 00:45:51 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2001-12-01 00:45:51 +0000 |
commit | 5708cc172e28f36986d8f3a11d53b45236dd5782 (patch) | |
tree | 7a9336e1b96baf0dd6cb4d692666feac7e386e8f /cpp/src/Ice/TraceUtil.cpp | |
parent | fixing compiler errors (diff) | |
download | ice-5708cc172e28f36986d8f3a11d53b45236dd5782.tar.bz2 ice-5708cc172e28f36986d8f3a11d53b45236dd5782.tar.xz ice-5708cc172e28f36986d8f3a11d53b45236dd5782.zip |
addressing
Diffstat (limited to 'cpp/src/Ice/TraceUtil.cpp')
-rw-r--r-- | cpp/src/Ice/TraceUtil.cpp | 64 |
1 files changed, 46 insertions, 18 deletions
diff --git a/cpp/src/Ice/TraceUtil.cpp b/cpp/src/Ice/TraceUtil.cpp index f2f386aab24..b3f83322328 100644 --- a/cpp/src/Ice/TraceUtil.cpp +++ b/cpp/src/Ice/TraceUtil.cpp @@ -11,6 +11,7 @@ #include <Ice/TraceUtil.h> #include <Ice/Instance.h> #include <Ice/Object.h> +#include <Ice/Proxy.h> #include <Ice/TraceLevels.h> #include <Ice/Logger.h> #include <Ice/BasicStream.h> @@ -65,6 +66,49 @@ printHeader(ostream& s, BasicStream& stream) s << "\nmessage size = " << size; } +static void +printRequestHeader(ostream& s, BasicStream& stream) +{ + string identity; + string facet; + Byte gotProxy; + stream.read(gotProxy); + s << "\naddressing = " << static_cast<int>(gotProxy); + if (gotProxy) + { + s << " (proxy)"; + ObjectPrx proxy; + stream.read(proxy); + identity = proxy->ice_getIdentity(); + facet = proxy->ice_getFacet(); + } + else + { + s << " (identity)"; + stream.read(identity); + stream.read(facet); + } + s << "\nidentity = " << identity; + s << "\nfacet = " << facet; + string operation; + stream.read(operation); + s << "\noperation = " << operation; + Int sz; + stream.read(sz); + s << "\ncontext = "; + while (sz--) + { + pair<string, string> pair; + stream.read(pair.first); + stream.read(pair.second); + s << pair.first << '/' << pair.second; + if (sz) + { + s << ", "; + } + } +} + void IceInternal::traceHeader(const char* heading, const BasicStream& str, const ::Ice::LoggerPtr& logger, const TraceLevelsPtr& tl) @@ -101,15 +145,7 @@ IceInternal::traceRequest(const char* heading, const BasicStream& str, const ::I { s << " (oneway)"; } - string identity; - stream.read(identity); - s << "\nidentity = " << identity; - string facet; - stream.read(facet); - s << "\nfacet = " << facet; - string operation; - stream.read(operation); - s << "\noperation name = " << operation; + printRequestHeader(s, stream); logger->trace(tl->protocolCat, s.str()); stream.i = p; } @@ -131,15 +167,7 @@ IceInternal::traceBatchRequest(const char* heading, const BasicStream& str, cons while (stream.i != stream.b.end()) { s << "\nrequest #" << cnt++ << ':'; - string identity; - stream.read(identity); - s << "\nidentity = " << identity; - string facet; - stream.read(facet); - s << "\nfacet = " << facet; - string operation; - stream.read(operation); - s << "\noperation name = " << operation; + printRequestHeader(s, stream); stream.skipEncaps(); } logger->trace(tl->protocolCat, s.str()); |