예제 #1
0
 /// <inheritdoc/>
 public EventInfo LogEvent(string eventName, string data)
 {
     var info = new EventInfo(this.WriteStartEvent(eventName));
     this.xmlLogWriter.WriteString(data);
     this.WriteEndEvent();
     return info;
 }
예제 #2
0
 /// <inheritdoc/>
 public EventInfo LogData(string type, string direction, byte[] buffer, int index, int count)
 {
     BufferHelper.AssertValidRange(buffer, "buffer", index, "index", count, "count");
     var info = new EventInfo(this.WriteStartEvent(type));
     this.xmlLogWriter.WriteAttributeString(LogNames.Direction, direction);
     this.xmlLogWriter.WriteBinHex(buffer, index, count);
     this.WriteEndEvent();
     return info;
 }
예제 #3
0
        /// <inheritdoc/>
        public EventInfo LogException(string direction, Exception exception)
        {
            if (exception == null)
            {
                throw new ArgumentNullException(nameof(exception));
            }

            var info = new EventInfo(this.WriteStartEvent(LogNames.Exception));
            this.xmlLogWriter.WriteAttributeString(LogNames.Direction, direction);
            this.xmlLogWriter.WriteString(exception.ToString());
            this.WriteEndEvent();
            return info;
        }