예제 #1
0
 public LogEntry(
     ILogSeverity severity,
     DateTime moment,
     LogSource source,
     Guid sequenceId,
     EventId eventId,
     Object data,
     IDictionary <String, Object> metadata,
     Exception exception)
 {
     Severity   = severity ?? throw new ArgumentNullException(nameof(severity), $"'{nameof(severity)}' is not allowed to be null.");
     Moment     = moment;
     Source     = source ?? throw new ArgumentNullException(nameof(source), $"'{nameof(source)}' is not allowed to be null.");
     SequenceId = sequenceId;
     EventId    = eventId;
     Data       = data ?? throw new ArgumentNullException(nameof(data), $"'{nameof(data)}' is not allowed to be null.");
     Metadata   = metadata ?? throw new ArgumentNullException(nameof(metadata), $"'{nameof(metadata)}' is not allowed to be null.");
     Exception  = exception;
 }
예제 #2
0
 public LogEntry With(
     ILogSeverity severity = null,
     DateTime?moment       = null,
     LogSource source      = null,
     Guid?sequenceId       = null,
     EventId?eventId       = null,
     Object data           = null,
     IDictionary <String, Object> metadata = null,
     Exception exception = null
     ) =>
 new LogEntry(
     severity ?? Severity,
     moment ?? Moment,
     source ?? Source,
     sequenceId ?? SequenceId,
     eventId ?? EventId,
     data ?? Data,
     metadata ?? Metadata,
     exception ?? Exception
     );
예제 #3
0
 // ReSharper disable MemberCanBePrivate.Global
 // ReSharper disable BuiltInTypeReferenceStyle
 // ReSharper disable ConvertIfStatementToReturnStatement
 // ReSharper disable ArrangeThisQualifier
 protected bool Equals(LogSource other)
 {
     return(Names.SequenceEqual(other.Names));
 }
예제 #4
0
 public LogSource Plus(LogSource source) =>
 new LogSource(Names.Concat(source.Names));