Ejemplo n.º 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;
 }
Ejemplo n.º 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
     );
Ejemplo n.º 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));
 }
Ejemplo n.º 4
0
 public LogSource Plus(LogSource source) =>
 new LogSource(Names.Concat(source.Names));