/// <summary>
        /// Creates a new instance of
        /// <see cref="JsonPacket" /> for the specified
        /// <paramref name="project" />.
        /// </summary>
        /// <param name="project">The project.</param>
        /// <param name="message">The message to capture.</param>
        /// <param name="level">The <see cref="ErrorLevel" /> of the captured <paramref name="message" />. Default <see cref="ErrorLevel.Info" />.</param>
        /// <param name="tags">The tags to annotate the captured <paramref name="message" /> with.</param>
        /// <param name="extra">The extra metadata to send with the captured <paramref name="message" />.</param>
        /// <returns>
        /// A new instance of <see cref="JsonPacket" /> for the specified <paramref name="project" />.
        /// </returns>
        public JsonPacket Create(string project,
                                 SentryMessage message,
                                 ErrorLevel level = ErrorLevel.Info,
                                 IDictionary<string, string> tags = null,
                                 object extra = null)
        {
            var json = new JsonPacket(project)
            {
                Message = message != null ? message.ToString() : null,
                MessageObject = message,
                Level = level,
                Tags = tags,
                Extra = extra
            };

            return OnCreate(json);
        }
        public JsonPacket Create(string project,
            SentryMessage message,
            ErrorLevel level = ErrorLevel.Info,
            IDictionary<string, string> tags = null,
            string[] fingerprint = null,
            object extra = null)
        {
            var @event = new SentryEvent(message)
            {
                Level = level,
                Extra = extra,
                Tags = tags,
                Fingerprint = fingerprint
            };

            return Create(project, @event);
        }
        public async Task<string> CaptureExceptionAsync(Exception exception,
                                                        SentryMessage message = null,
                                                        ErrorLevel level = ErrorLevel.Error,
                                                        IDictionary<string, string> tags = null,
                                                        string[] fingerprint = null,
                                                        object extra = null)
        {
            var @event = new SentryEvent(exception)
            {
                Message = message,
                Level = level,
                Extra = extra,
                Tags = tags,
                Fingerprint = fingerprint
            };

            return await CaptureAsync(@event);
        }
        /// <summary>
        /// Captures the message.
        /// </summary>
        /// <param name="message">The message to capture.</param>
        /// <param name="level">The <see cref="ErrorLevel" /> of the captured message.</param>
        /// <param name="tags">The tags to annotate the captured exception with.</param>
        /// <param name="extra">The extra metadata to send with the captured exception.</param>
        /// <returns>
        /// The <see cref="JsonPacket.EventID"/> of the successfully captured message, or <c>null</c> if it fails.
        /// </returns>
        public string CaptureMessage(string message,
            ErrorLevel level = ErrorLevel.Info,
            Dictionary<string, string> tags = null,
            object extra = null)
        {
            JsonPacket packet = new JsonPacket(CurrentDsn.ProjectID)
            {
                Message = message,
                Level = level,
                Tags = tags,
                Extra = extra
            };

            return Send(packet, CurrentDsn);
        }
        public int CaptureMessage(string message, ErrorLevel level = ErrorLevel.info, string[][] tags = null, object extra = null)
        {
            JsonPacket packet = new JsonPacket(CurrentDSN.ProjectID);
            packet.Message = message;
            packet.Level = level;
            packet.Tags = tags;
            packet.Extra = extra;

            Send(packet, CurrentDSN);

            return 0;
        }
Exemple #6
0
 public int CaptureMessage(string message, ErrorLevel level, Dictionary<string, string> tags)
 {
     return CaptureMessage(message, level, tags, null);
 }
Exemple #7
0
 public int CaptureMessage(string message, ErrorLevel level)
 {
     return CaptureMessage(message, level, null, null);
 }
Exemple #8
0
        public int CaptureMessage(string message, ErrorLevel level /*= ErrorLevel.info*/, Dictionary<string, string> tags /*= null*/, object extra /*= null*/)
        {
            JsonPacket packet = new JsonPacket(CurrentDSN.ProjectID);
            packet.Message = message;
            packet.Level = level;
            packet.Tags = tags;
            packet.Extra = extra;

            Send(packet, CurrentDSN);

            return 0;
        }
        public string CaptureMessage(SentryMessage message,
            ErrorLevel level = ErrorLevel.Info,
            IDictionary<string, string> tags = null,
            string[] fingerprint = null,
            object extra = null)
        {
            var @event = new SentryEvent(message)
            {
                Level = level,
                Extra = extra,
                Tags = MergeTags(tags),
                Fingerprint = fingerprint
            };

            return Capture(@event);
        }
Exemple #10
0
        public string CaptureException(Exception exception,
            SentryMessage message = null,
            ErrorLevel level = ErrorLevel.Error,
            IDictionary<string, string> tags = null,
            string[] fingerprint = null,
            object extra = null)
        {
            var @event = new SentryEvent(exception)
            {
                Message = message,
                Level = level,
                Extra = extra,
                Tags = MergeTags(tags),
                Fingerprint = fingerprint
            };

            return Capture(@event);
        }
        public JsonPacket Create(string project,
            Exception exception,
            SentryMessage message = null,
            ErrorLevel level = ErrorLevel.Error,
            IDictionary<string, string> tags = null,
            string[] fingerprint = null,
            object extra = null)
        {
            var @event = new SentryEvent(exception)
            {
                Message = message,
                Level = level,
                Extra = extra,
                Tags = tags,
                Fingerprint = fingerprint,
            };

            return Create(project, @event);
        }
Exemple #12
0
 /// <summary>
 /// Captures the message.
 /// </summary>
 /// <param name="message">The message to capture.</param>
 /// <param name="level">The <see cref="ErrorLevel" /> of the captured <paramref name="message" />. Default <see cref="ErrorLevel.Info" />.</param>
 /// <param name="tags">The tags to annotate the captured <paramref name="message" /> with.</param>
 /// <param name="extra">The extra metadata to send with the captured <paramref name="message" />.</param>
 /// <returns>
 /// The <see cref="JsonPacket.EventID" /> of the successfully captured <paramref name="message" />, or <c>null</c> if it fails.
 /// </returns>
 public string CaptureMessage(SentryMessage message,
     ErrorLevel level = ErrorLevel.Info,
     Dictionary<string, string> tags = null,
     object extra = null)
 {
     JsonPacket packet = this.jsonPacketFactory.Create(CurrentDsn.ProjectID, message, level, tags, extra);
     return Send(packet, CurrentDsn);
 }
Exemple #13
0
 /// <summary>
 /// Captures the <see cref="Exception" />.
 /// </summary>
 /// <param name="exception">The <see cref="Exception" /> to capture.</param>
 /// <param name="message">The optional messge to capture. Default: <see cref="Exception.Message" />.</param>
 /// <param name="level">The <see cref="ErrorLevel" /> of the captured <paramref name="exception" />. Default: <see cref="ErrorLevel.Error" />.</param>
 /// <param name="tags">The tags to annotate the captured <paramref name="exception" /> with.</param>
 /// <param name="extra">The extra metadata to send with the captured <paramref name="exception" />.</param>
 /// <returns>
 /// The <see cref="JsonPacket.EventID" /> of the successfully captured <paramref name="exception" />, or <c>null</c> if it fails.
 /// </returns>
 public string CaptureException(Exception exception,
     SentryMessage message = null,
     ErrorLevel level = ErrorLevel.Error,
     IDictionary<string, string> tags = null,
     object extra = null)
 {
     JsonPacket packet = this.jsonPacketFactory.Create(this.currentDsn.ProjectID,
                                                       exception,
                                                       message,
                                                       level,
                                                       tags,
                                                       extra);
     return Send(packet, CurrentDsn);
 }
        public async Task<string> CaptureMessageAsync(SentryMessage message,
                                                      ErrorLevel level = ErrorLevel.Info,
                                                      IDictionary<string, string> tags = null,
                                                      string[] fingerprint = null,
                                                      object extra = null)
        {
            var @event = new SentryEvent(message)
            {
                Level = level,
                Extra = extra,
                Tags = tags,
                Fingerprint = fingerprint
            };

            return await CaptureAsync(@event);
        }
Exemple #15
0
 internal static void ReportAsync(string message, ErrorLevel level = ErrorLevel.Debug)
 {
     var @event = new SentryEvent(new SentryMessage(message));
     @event.Level = level;
     ReportAsync(@event);
 }