Exemple #1
0
        internal static void TraceSend(Ice.OutputStream str, Ice.ILogger logger, TraceLevels tl)
        {
            if (tl.Protocol >= 1)
            {
                var buffer = str.ToArray(); // TODO avoid copy the data
                var iss    = new InputStream(str.Communicator, str.Encoding, buffer);
                iss.Pos = 0;

                using var s = new System.IO.StringWriter(CultureInfo.CurrentCulture);
                byte type = PrintMessage(s, iss);

                logger.Trace(tl.ProtocolCat, "sending " + GetMessageTypeAsString(type) + " " + s.ToString());
            }
        }
Exemple #2
0
        internal static void TraceRecv(Ice.InputStream str, Ice.ILogger logger, TraceLevels tl)
        {
            if (tl.Protocol >= 1)
            {
                int p = str.Pos;
                str.Pos = 0;

                using (var s = new System.IO.StringWriter(CultureInfo.CurrentCulture))
                {
                    Ice1Definitions.MessageType type = PrintMessage(s, str);

                    logger.Trace(tl.ProtocolCat, "received " + GetMessageTypeAsString(type) + " " + s.ToString());
                }
                str.Pos = p;
            }
        }
Exemple #3
0
        internal static void Trace(string heading, Ice.InputStream str, Ice.ILogger logger, TraceLevels tl)
        {
            if (tl.Protocol >= 1)
            {
                int p = str.Pos;
                str.Pos = 0;

                using (var s = new System.IO.StringWriter(CultureInfo.CurrentCulture))
                {
                    s.Write(heading);
                    PrintMessage(s, str);

                    logger.Trace(tl.ProtocolCat, s.ToString());
                }
                str.Pos = p;
            }
        }
Exemple #4
0
 internal static void TraceSlicing(string kind, string typeId, string slicingCat, Ice.ILogger logger)
 {
     lock (_mutex)
     {
         if (_slicingIds.Add(typeId))
         {
             using var s = new System.IO.StringWriter(CultureInfo.CurrentCulture);
             s.Write("unknown " + kind + " type `" + typeId + "'");
             logger.Trace(slicingCat, s.ToString());
         }
     }
 }