private void OnTrace(object sender, SocketTraceEventArgs e)
        {
            _onTrace?.Invoke(e.Description);
            var desc = e.Description ?? string.Empty;

            if (!string.IsNullOrWhiteSpace(e.Payload))
            {
                try
                {
                    var json = JObject.Parse(e.Payload);
                    desc += "\n" + json.ToString(Formatting.Indented);
                }
                catch (Exception)
                {
                    // ignored
                }
            }

            _log.Trace(desc);
        }
Example #2
0
 protected virtual void OnTrace(SocketTraceEventArgs e)
 {
     Trace?.Invoke(this, e);
 }
Example #3
0
        protected virtual void OnTrace(XenLogLevel level, string description)
        {
            var args = new SocketTraceEventArgs(description, null, level);

            OnTrace(args);
        }
Example #4
0
 internal virtual void OnTrace(SocketTraceEventArgs e)
 {
     Trace?.Invoke(this, e);
 }
Example #5
0
        internal virtual void OnTrace(XenLogLevel level, string description)
        {
            var e = new SocketTraceEventArgs(description, null, level);

            Trace?.Invoke(this, e);
        }