/// <summary> /// Initializes a new instance of the <see cref="XmlMessageStream"/> class. /// </summary> /// <param name="stream">The base stream to use for reading and writing XML messages.</param> /// <param name="xmlRootTag">The XML root tag of the XML messages.</param> /// <param name="traceDescription">The WWI trace description.</param> /// <param name="traceEndPoint">The WWI trace endpoint.</param> public XmlMessageStream(Stream stream, string xmlRootTag, string traceDescription = null, string traceEndPoint = null) { if (stream == null) { throw new ArgumentException("Invalid stream specified."); } if (string.IsNullOrEmpty(xmlRootTag)) { throw new ArgumentException("Invalid xmlRootTag specified."); } _stream = stream; _xmlEndTag = Encoding.UTF8.GetBytes(string.Format(MessageEndTemplate, xmlRootTag)); if ((string.IsNullOrEmpty(traceDescription) == false) && (string.IsNullOrEmpty(traceEndPoint) == false)) { ushort tracePort = 0; int index = traceEndPoint.IndexOf(':'); if ((index > 0) && (index < traceEndPoint.Length - 1)) { ushort.TryParse(traceEndPoint.Substring(index + 1), out tracePort); traceEndPoint = traceEndPoint.Substring(0, index); } WwiLogIntercept.CreateBaseWwiLogger(traceDescription, traceEndPoint, tracePort); _messageTrace = WwiLogIntercept.GetSingleton(); } }
public WwiLogger() { WwiLogIntercept.SetSecondWwiLogger(this); }