public void LogMessage(Guid uniqueClientId, DiagnosticMessageType messageType, string message) { if (uniqueClientId == Guid.Empty) { throw new ArgumentException("Argument can't be Guid.Empty.", "uniqueClientId"); } if (string.IsNullOrEmpty(message)) { throw new ArgumentException("Argument can't be null nor empty.", "message"); } lock (_mutex) { List <DiagnosticMessage> diagnosticMessages; if (!_diagnosticMessagesByClientId.TryGetValue(uniqueClientId, out diagnosticMessages)) { diagnosticMessages = new List <DiagnosticMessage>(); _diagnosticMessagesByClientId.Add(uniqueClientId, diagnosticMessages); } long messageId = ++_prevMessageId; diagnosticMessages.Add( new DiagnosticMessage( messageId, DateTime.UtcNow, messageType, message)); } }
private void PostDiagnosticMessage(string message, DiagnosticMessageType diagnosticMessageType) { if (string.IsNullOrEmpty(message)) { throw new ArgumentException("Argument can't be null nor empty.", "message"); } OnDiagnosticMessagePosted(this, new DiagnosticMessageEventArgs(diagnosticMessageType, message)); }
protected void PostDiagnosticMessage(string message, DiagnosticMessageType diagnosticMessageType) { if (string.IsNullOrEmpty(message)) { throw new ArgumentException("Argument can't be null nor empty.", "message"); } OnDiagnosticMessagePosted(this, new DiagnosticMessageEventArgs(diagnosticMessageType, message)); }
public DiagnosticMessageEventArgs(DiagnosticMessageType messageType, string message) { if (string.IsNullOrEmpty(message)) { throw new ArgumentException("Argument can't be null nor empty.", "message"); } MessageType = messageType; Message = message; }
public DiagnosticMessage(long messageId, DateTime dateUtf, DiagnosticMessageType type, string message) { if (string.IsNullOrEmpty(message)) { throw new ArgumentException("Argument can't be null nor empty.", "message"); } if (dateUtf.Kind != DateTimeKind.Utc) { throw new ArgumentException("Argument must be a UTC date.", "dateUtf"); } MessageId = messageId; DateUtf = dateUtf; Type = type; Message = message; }
private void LogMessage(string message, DiagnosticMessageType messageType = DiagnosticMessageType.Info) { GuiUtils.BeginInvoke( this, () => { if (messageType < MessageTypeThreshold) { return; } txt_log.SelectionStart = txt_log.Text.Length; txt_log.SelectionLength = 0; switch (messageType) { case DiagnosticMessageType.Trace: txt_log.SelectionColor = Color.DimGray; break; case DiagnosticMessageType.Info: txt_log.SelectionColor = Color.Blue; break; case DiagnosticMessageType.Warn: txt_log.SelectionColor = Color.FromArgb(191, 79, 0); break; case DiagnosticMessageType.Error: txt_log.SelectionColor = Color.DarkRed; break; } txt_log.AppendText(message); txt_log.AppendText(Environment.NewLine); txt_log.ScrollToCaret(); }); }
public DiagnosticMessage(string text, DiagnosticMessageType type) { Text = text; Type = type; }
public List <DiagnosticMessage> GetDiagnosticMessages(Guid uniqueClientId, long lastSeenMaxMessageId, DiagnosticMessageType minMessageType) { return(Exec(@as => @as.GetDiagnosticMessages(uniqueClientId, lastSeenMaxMessageId, minMessageType))); }
protected void LogMessage(string message, DiagnosticMessageType messageType) { _log.DebugIfEnabled(() => string.Format("{0}: {1}", messageType, message)); }
public void LogMessage(Guid uniqueClientId, DiagnosticMessageType messageType, string message) { if (uniqueClientId == Guid.Empty) { throw new ArgumentException("Argument can't be Guid.Empty.", "uniqueClientId"); } if (string.IsNullOrEmpty(message)) { throw new ArgumentException("Argument can't be null nor empty.", "message"); } lock (_mutex) { List<DiagnosticMessage> diagnosticMessages; if (!_diagnosticMessagesByClientId.TryGetValue(uniqueClientId, out diagnosticMessages)) { diagnosticMessages = new List<DiagnosticMessage>(); _diagnosticMessagesByClientId.Add(uniqueClientId, diagnosticMessages); } long messageId = ++_prevMessageId; diagnosticMessages.Add( new DiagnosticMessage( messageId, DateTime.UtcNow, messageType, message)); } }
protected void LogMessage(string message, DiagnosticMessageType messageType) { OutputWriter.WriteLine("[{0}] {1}", messageType.ToString(), message); }