public LogEvent(TimeSpan timestamp, string threadId, LogEventKind kind, string projectOrTargetName, string childThreadId, string projectTarget) { if (string.IsNullOrEmpty(threadId)) { throw new ArgumentException("Value cannot be null or empty.", nameof(threadId)); } if (string.IsNullOrEmpty(projectOrTargetName)) { throw new ArgumentException("Value cannot be null or empty.", nameof(projectOrTargetName)); } this.Timestamp = timestamp; this.ThreadId = threadId; this.Kind = kind; this.ProjectOrTargetName = projectOrTargetName; this.ChildThreadId = childThreadId; this.ProjectTarget = projectTarget; }
private static void RawLog(LogEventKind kind, LogSource source, Exception exception, String message, Object[] items) { if (Handler is null) { return; } var li = new LogInformation { Kind = kind, Source = source, Timestamp = new TimeSpan(DateTime.UtcNow.Ticks), Message = message, Exception = exception, Items = items, }; Handler.Enqueue(li); }
public LogEventHandler(LogEventKind kind, LogDelegate onLog) : this() { this._eventKind = kind; this.OnLog += onLog; }