void Pusher_OnLog(object sender, PusherLogEventArgs e) { if (textBoxConsole.InvokeRequired) { textBoxConsole.Invoke((Action)(() => Pusher_OnLog(sender, e))); return; } textBoxConsole.Text += e.Message; foreach (object obj in e.Additional) { textBoxConsole.Text += " | "; if (obj is JsonData) { textBoxConsole.Text += Pusher.JSON.stringify(obj); } else { textBoxConsole.Text += obj == null ? "null" : obj.ToString(); } } textBoxConsole.Text += Environment.NewLine; textBoxConsole.Select(textBoxConsole.Text.Length, 0); }
private void Pusher_OnLog(object sender, PusherLogEventArgs e) { StringBuilder msg = new StringBuilder(); msg.AppendLine(e.Message); foreach (object obj in e.Additional) { if (obj is JsonData) { msg.AppendLine(Pusher.JSON.stringify(obj)); } else { msg.AppendLine(obj == null ? "null" : obj.ToString()); } } Log(msg.ToString()); }