コード例 #1
0
 /// <summary>
 /// Builds an event with the current data in this builder. If you want to create and send an event immediately,
 /// use <see cref="CaptureAsync"/> instead.
 /// </summary>
 public SentryEvent Build()
 {
     return(new SentryEvent
     {
         EventId = (EventId ?? Guid.NewGuid()).ToString("N"),
         Timestamp = Timestamp ?? DateTime.UtcNow,
         Logger = Logger,
         Platform = Platform,
         Sdk = Sdk,
         Level = Level ?? (Exception == null ? SeverityLevel.Info : SeverityLevel.Error),
         Culprit = Culprit,
         ServerName = ServerName,
         Release = Release,
         Tags = Tags.Any() ? Tags.ToDictionary(p => p.Key, p => p.Value) : null,
         Environment = Environment,
         Modules = Modules.Any() ? Modules : null,
         Extra = Extra,
         Fingerprint = Fingerprint.Any() ? Fingerprint : null,
         Exception = Exception != null && Exception.Any() ? Exception : null,
         Message = Message,
         Breadcrumbs = Breadcrumbs,
         Request = Request,
         User = User,
         Contexts = Contexts.Any() ? Contexts.ToDictionary(p => p.Key, p => p.Value) : null
     });
 }