コード例 #1
0
            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;
            }
コード例 #2
0
ファイル: Log.cs プロジェクト: CaesuraSoftware/ARNaLD
        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);
        }
コード例 #3
0
 public LogEventHandler(LogEventKind kind, LogDelegate onLog) : this()
 {
     this._eventKind = kind;
     this.OnLog     += onLog;
 }