From 36ef2522d302332b0250b62050c14de5afe8c469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Ulsberg?= Date: Fri, 13 Dec 2013 16:27:50 +0100 Subject: [PATCH 01/11] Added XML documentation to ErrorLevelConverter --- SharpRaven/Serialization/ErrorLevelConverter.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/SharpRaven/Serialization/ErrorLevelConverter.cs b/SharpRaven/Serialization/ErrorLevelConverter.cs index 4fbbebaf..a3dde31b 100644 --- a/SharpRaven/Serialization/ErrorLevelConverter.cs +++ b/SharpRaven/Serialization/ErrorLevelConverter.cs @@ -5,8 +5,17 @@ namespace SharpRaven.Serialization { + /// + /// Converts to a . + /// public class ErrorLevelConverter : StringEnumConverter { + /// + /// Writes the JSON representation of the object. + /// + /// The to write to. + /// The value. + /// The calling serializer. public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { if (!(value is ErrorLevel)) From b40ab31751d3bcb0c149fe38c3cedd2eb9b75a8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Ulsberg?= Date: Fri, 13 Dec 2013 16:28:04 +0100 Subject: [PATCH 02/11] Added XML documentation to ExceptionFrame --- SharpRaven/Data/ExceptionFrame.cs | 69 +++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/SharpRaven/Data/ExceptionFrame.cs b/SharpRaven/Data/ExceptionFrame.cs index 2f4b801a..ec3073f7 100644 --- a/SharpRaven/Data/ExceptionFrame.cs +++ b/SharpRaven/Data/ExceptionFrame.cs @@ -3,37 +3,106 @@ using Newtonsoft.Json; namespace SharpRaven.Data { + /// + /// Represents Sentry's version of . + /// public class ExceptionFrame { + /// + /// Gets or sets the absolute path. + /// + /// + /// The absolute path. + /// [JsonProperty(PropertyName = "abs_path")] public string AbsolutePath { get; set; } + /// + /// Gets or sets the filename. + /// + /// + /// The filename. + /// [JsonProperty(PropertyName = "filename")] public string Filename { get; set; } + /// + /// Gets or sets the module. + /// + /// + /// The module. + /// [JsonProperty(PropertyName = "module")] public string Module { get; set; } + /// + /// Gets or sets the function. + /// + /// + /// The function. + /// [JsonProperty(PropertyName = "function")] public string Function { get; set; } + /// + /// Gets or sets the vars. + /// + /// + /// The vars. + /// [JsonProperty(PropertyName = "vars")] public Dictionary Vars { get; set; } + /// + /// Gets or sets the preference context. + /// + /// + /// The preference context. + /// [JsonProperty(PropertyName = "pre_context")] public List PreContext { get; set; } + /// + /// Gets or sets the source. + /// + /// + /// The source. + /// [JsonProperty(PropertyName = "context_line")] public string Source { get; set; } + /// + /// Gets or sets the line number. + /// + /// + /// The line number. + /// [JsonProperty(PropertyName = "lineno")] public int LineNumber { get; set; } + /// + /// Gets or sets the column number. + /// + /// + /// The column number. + /// [JsonProperty(PropertyName = "colno")] public int ColumnNumber { get; set; } + /// + /// Gets or sets a value indicating whether [information application]. + /// + /// + /// true if [information application]; otherwise, false. + /// [JsonProperty(PropertyName = "in_app")] public bool InApp { get; set; } + /// + /// Gets or sets the post context. + /// + /// + /// The post context. + /// [JsonProperty(PropertyName = "post_context")] public List PostContext { get; set; } } From 7ce550979c3bf598076d54351db4179663b55c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Ulsberg?= Date: Fri, 13 Dec 2013 16:28:17 +0100 Subject: [PATCH 03/11] Added XML documentation to JsonPacket --- SharpRaven/Data/JsonPacket.cs | 40 ++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/SharpRaven/Data/JsonPacket.cs b/SharpRaven/Data/JsonPacket.cs index a46cae22..157cfeef 100644 --- a/SharpRaven/Data/JsonPacket.cs +++ b/SharpRaven/Data/JsonPacket.cs @@ -8,8 +8,15 @@ namespace SharpRaven.Data { + /// + /// Represents the JSON packet that is transmitted to Sentry. + /// public class JsonPacket { + /// + /// Initializes a new instance of the class. + /// + /// The project. public JsonPacket(string project) { // Get assemblies. @@ -45,6 +52,11 @@ public JsonPacket(string project) } + /// + /// Initializes a new instance of the class. + /// + /// The project. + /// The decimal. public JsonPacket(string project, Exception e) { Message = e.Message; @@ -156,25 +168,47 @@ public JsonPacket(string project, Exception e) /// /// A list of relevant modules (libraries) and their versions. - /// /// Automated to report all modules currently loaded in project. /// + /// + /// The modules. + /// [JsonProperty(PropertyName = "modules", NullValueHandling = NullValueHandling.Ignore)] public List Modules { get; set; } + /// + /// Gets or sets the exceptions. + /// + /// + /// The exceptions. + /// [JsonProperty(PropertyName = "exception", NullValueHandling = NullValueHandling.Ignore)] public List Exceptions { get; set; } + /// + /// Gets or sets the object, containing information about the HTTP request. + /// + /// + /// The object, containing information about the HTTP request. + /// [JsonProperty(PropertyName = "request", NullValueHandling = NullValueHandling.Ignore)] public SentryRequest Request { get; set; } + /// + /// Gets or sets the object, which describes the authenticated User for a request. + /// + /// + /// The object, which describes the authenticated User for a request. + /// [JsonProperty(PropertyName = "user", NullValueHandling = NullValueHandling.Ignore)] public SentryUser User { get; set; } /// - /// Turn into a JSON string. + /// Converts the into a JSON string. /// - /// json string + /// + /// The as a JSON string. + /// public override string ToString() { return JsonConvert.SerializeObject(this); From f12140b4710b981401e1beb891c30accb7b9e11d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Ulsberg?= Date: Fri, 13 Dec 2013 16:28:25 +0100 Subject: [PATCH 04/11] Added XML documentation to LogScrubber --- SharpRaven/Logging/LogScrubber.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/SharpRaven/Logging/LogScrubber.cs b/SharpRaven/Logging/LogScrubber.cs index dd53d271..d08f7863 100644 --- a/SharpRaven/Logging/LogScrubber.cs +++ b/SharpRaven/Logging/LogScrubber.cs @@ -3,10 +3,22 @@ using SharpRaven.Logging.Filters; namespace SharpRaven.Logging { + /// + /// Scrubs a JSON packet for sensitive information with , and . + /// public class LogScrubber : IScrubber { + /// + /// Gets the list of filters + /// + /// + /// The filters. + /// public List Filters { get; private set; } // Default scrubber implementation. + /// + /// Initializes a new instance of the class. + /// public LogScrubber() { Filters = new List(); @@ -18,6 +30,14 @@ public LogScrubber() { }); } + /// + /// The main interface for scrubbing a JSON packet, + /// called before compression (if enabled) + /// + /// The serialized JSON packet is given here. + /// + /// Scrubbed JSON packet. + /// public string Scrub(string input) { foreach (IFilter f in Filters) { input = f.Filter(input); From a2705a0d4db44d2b6ccd4595cfb74ea25381a9b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Ulsberg?= Date: Fri, 13 Dec 2013 16:28:31 +0100 Subject: [PATCH 05/11] Added XML documentation to PacketBuilder --- SharpRaven/Utilities/PacketBuilder.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/SharpRaven/Utilities/PacketBuilder.cs b/SharpRaven/Utilities/PacketBuilder.cs index f9dad247..9840b06e 100644 --- a/SharpRaven/Utilities/PacketBuilder.cs +++ b/SharpRaven/Utilities/PacketBuilder.cs @@ -3,7 +3,17 @@ using System.Text; namespace SharpRaven.Utilities { + /// + /// Utility class for building + /// public static class PacketBuilder { + /// + /// Creates the authentication header base on the provided . + /// + /// The DSN. + /// + /// The authentication header. + /// public static string CreateAuthenticationHeader(Dsn dsn) { string header = String.Empty; header += "Sentry sentry_version=4"; From cd0871dbd84dc435234c796d7f0e9de4158e4a19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Ulsberg?= Date: Fri, 13 Dec 2013 16:28:48 +0100 Subject: [PATCH 06/11] Added and changed the XML documentation for RavenClient --- SharpRaven/RavenClient.cs | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/SharpRaven/RavenClient.cs b/SharpRaven/RavenClient.cs index 451f792d..c5a14ef1 100644 --- a/SharpRaven/RavenClient.cs +++ b/SharpRaven/RavenClient.cs @@ -185,20 +185,31 @@ private bool Send(JsonPacket packet, Dsn dsn) #region Deprecated methods - /** + /* * These methods have been deprectaed in favour of the ones * that have the same names as the other sentry clients, this * is purely for the sake of consistency - */ - - + */ + + + /// + /// Captures the event. + /// + /// The to capture. + /// [Obsolete("The more common CaptureException method should be used")] public int CaptureEvent(Exception e) { return CaptureException(e); - } - - + } + + + /// + /// Captures the event. + /// + /// The to capture. + /// The tags to annotate the captured exception with. + /// [Obsolete("The more common CaptureException method should be used")] public int CaptureEvent(Exception e, Dictionary tags) { From 10682e744570a65f05399dab6a7126bba4d56f23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Ulsberg?= Date: Fri, 13 Dec 2013 16:28:54 +0100 Subject: [PATCH 07/11] Added XML documentation to SentryException --- SharpRaven/Data/SentryException.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/SharpRaven/Data/SentryException.cs b/SharpRaven/Data/SentryException.cs index 3aa8b8de..e854e2f1 100644 --- a/SharpRaven/Data/SentryException.cs +++ b/SharpRaven/Data/SentryException.cs @@ -2,6 +2,9 @@ using Newtonsoft.Json; namespace SharpRaven.Data { + /// + /// Represents Sentry's version of an . + /// public class SentryException { /// /// The type of exception. @@ -28,6 +31,10 @@ public class SentryException { public SentryStacktrace Stacktrace { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// The . public SentryException(Exception e) { this.Module = e.Source; this.Type = e.Message; From e150f4bcafb00ddba0573e21decc5741d5f61b37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Ulsberg?= Date: Fri, 13 Dec 2013 16:29:00 +0100 Subject: [PATCH 08/11] Added XML documentation to SentryRequest --- SharpRaven/Data/SentryRequest.cs | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/SharpRaven/Data/SentryRequest.cs b/SharpRaven/Data/SentryRequest.cs index a5374138..ed0d1962 100644 --- a/SharpRaven/Data/SentryRequest.cs +++ b/SharpRaven/Data/SentryRequest.cs @@ -41,9 +41,21 @@ private bool HasHttpContext } + /// + /// Gets or sets the URL of the HTTP request. + /// + /// + /// The URL of the HTTP request. + /// [JsonProperty(PropertyName = "url", NullValueHandling = NullValueHandling.Ignore)] public string Url { get; set; } + /// + /// Gets or sets the method of the HTTP request. + /// + /// + /// The method of the HTTP request. + /// [JsonProperty(PropertyName = "method", NullValueHandling = NullValueHandling.Ignore)] public string Method { get; set; } @@ -56,12 +68,30 @@ private bool HasHttpContext [JsonProperty(PropertyName = "data", NullValueHandling = NullValueHandling.Ignore)] public object Data { get; set; } + /// + /// Gets or sets the query string. + /// + /// + /// The query string. + /// [JsonProperty(PropertyName = "query_string", NullValueHandling = NullValueHandling.Ignore)] public string QueryString { get; set; } + /// + /// Gets or sets the cookies. + /// + /// + /// The cookies. + /// [JsonProperty(PropertyName = "cookies", NullValueHandling = NullValueHandling.Ignore)] public IDictionary Cookies { get; set; } + /// + /// Gets or sets the headers. + /// + /// + /// The headers. + /// [JsonProperty(PropertyName = "headers", NullValueHandling = NullValueHandling.Ignore)] public IDictionary Headers { get; set; } @@ -76,6 +106,12 @@ private bool HasHttpContext public IDictionary Environment { get; set; } + /// + /// Gets the request. + /// + /// + /// If an HTTP contest is available, an instance of , otherwise null. + /// public static SentryRequest GetRequest() { var request = new SentryRequest(); @@ -83,6 +119,12 @@ public static SentryRequest GetRequest() } + /// + /// Gets the user. + /// + /// + /// If an HTTP context is available, an instance of , otherwise null. + /// public SentryUser GetUser() { if (!HasHttpContext) From a7b651ff4b6863739e0004aad19c5d9b1186de9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Ulsberg?= Date: Fri, 13 Dec 2013 16:29:06 +0100 Subject: [PATCH 09/11] Added XML documentation to SentryStacktrace --- SharpRaven/Data/SentryStacktrace.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/SharpRaven/Data/SentryStacktrace.cs b/SharpRaven/Data/SentryStacktrace.cs index 50bae11f..837e1627 100644 --- a/SharpRaven/Data/SentryStacktrace.cs +++ b/SharpRaven/Data/SentryStacktrace.cs @@ -7,7 +7,14 @@ using Newtonsoft.Json; namespace SharpRaven.Data { + /// + /// Represents Sentry's version of an 's stack trace. + /// public class SentryStacktrace { + /// + /// Initializes a new instance of the class. + /// + /// The decimal. public SentryStacktrace(Exception e) { StackTrace trace = new StackTrace(e, true); @@ -44,6 +51,12 @@ private static ExceptionFrame BuildExceptionFrame(StackFrame frame) }; } + /// + /// Gets or sets the frames. + /// + /// + /// The frames. + /// [JsonProperty(PropertyName = "frames")] public ExceptionFrame[] Frames { get; set; } From 042a0ab11f5468e41db2ef5f642d400557e8b736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Ulsberg?= Date: Fri, 13 Dec 2013 16:29:11 +0100 Subject: [PATCH 10/11] Added XML documentation to SentryUser --- SharpRaven/Data/SentryUser.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/SharpRaven/Data/SentryUser.cs b/SharpRaven/Data/SentryUser.cs index 4ba1148c..f3e2d417 100644 --- a/SharpRaven/Data/SentryUser.cs +++ b/SharpRaven/Data/SentryUser.cs @@ -24,15 +24,39 @@ public SentryUser(IPrincipal principal) } + /// + /// Gets or sets the user's unique identifier. + /// + /// + /// The unique identifier. + /// [JsonProperty(PropertyName = "id", NullValueHandling = NullValueHandling.Ignore)] public string Id { get; set; } + /// + /// Gets or sets the user's username. + /// + /// + /// The user's username. + /// [JsonProperty(PropertyName = "username", NullValueHandling = NullValueHandling.Ignore)] public string Username { get; set; } + /// + /// Gets or sets the user's email address. + /// + /// + /// The user's email address. + /// [JsonProperty(PropertyName = "email", NullValueHandling = NullValueHandling.Ignore)] public string Email { get; set; } + /// + /// Gets or sets the user's IP address. + /// + /// + /// The user's IP address. + /// [JsonProperty(PropertyName = "ip_address", NullValueHandling = NullValueHandling.Ignore)] public string IpAddress { get; set; } } From 6a1223d71a650548cbd44819ddc72a5b387b360e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Ulsberg?= Date: Fri, 13 Dec 2013 16:29:18 +0100 Subject: [PATCH 11/11] Added XML documentation to SystemUtil --- SharpRaven/Utilities/SystemUtil.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SharpRaven/Utilities/SystemUtil.cs b/SharpRaven/Utilities/SystemUtil.cs index b907caa3..902a8b47 100644 --- a/SharpRaven/Utilities/SystemUtil.cs +++ b/SharpRaven/Utilities/SystemUtil.cs @@ -4,11 +4,16 @@ using System.Reflection; namespace SharpRaven.Utilities { + /// + /// Utility class for retreiving system information. + /// public static class SystemUtil { /// /// Return all loaded modules. /// - /// + /// + /// All loaded modules. + /// public static Module[] GetModules() { // Get primary module. Assembly curAssembly = Assembly.GetExecutingAssembly();