Skip to content

Commit

Permalink
fixed brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmet Taha Sakar committed Feb 15, 2016
1 parent 03bd687 commit 0f59def
Showing 1 changed file with 25 additions and 50 deletions.
75 changes: 25 additions & 50 deletions Source/Shared/Extensions/ClientExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@
using Exceptionless.Logging;
using Exceptionless.Models;

namespace Exceptionless
{
public static class ClientExtensions
{
namespace Exceptionless {
public static class ClientExtensions {
/// <summary>
/// Submits an unhandled exception event.
/// </summary>
/// <param name="client">The client instance.</param>
/// <param name="exception">The unhandled exception.</param>
public static void SubmitUnhandledException(this ExceptionlessClient client, Exception exception)
{
public static void SubmitUnhandledException(this ExceptionlessClient client, Exception exception) {
var builder = exception.ToExceptionless(client: client);
builder.PluginContextData.MarkAsUnhandledError();
builder.Submit();
Expand All @@ -23,8 +20,7 @@ public static void SubmitUnhandledException(this ExceptionlessClient client, Exc
/// </summary>
/// <param name="client">The client instance.</param>
/// <param name="exception">The exception.</param>
public static void SubmitException(this ExceptionlessClient client, Exception exception)
{
public static void SubmitException(this ExceptionlessClient client, Exception exception) {
client.CreateException(exception).Submit();
}

Expand All @@ -33,8 +29,7 @@ public static void SubmitException(this ExceptionlessClient client, Exception ex
/// </summary>
/// <param name="client">The client instance.</param>
/// <param name="exception">The exception.</param>
public static EventBuilder CreateException(this ExceptionlessClient client, Exception exception)
{
public static EventBuilder CreateException(this ExceptionlessClient client, Exception exception) {
return exception.ToExceptionless(client: client);
}

Expand All @@ -43,8 +38,7 @@ public static EventBuilder CreateException(this ExceptionlessClient client, Exce
/// </summary>
/// <param name="client">The client instance.</param>
/// <param name="message">The log message.</param>
public static void SubmitLog(this ExceptionlessClient client, string message)
{
public static void SubmitLog(this ExceptionlessClient client, string message) {
client.CreateLog(message).Submit();
}

Expand All @@ -54,8 +48,7 @@ public static void SubmitLog(this ExceptionlessClient client, string message)
/// <param name="client">The client instance.</param>
/// <param name="source">The log source.</param>
/// <param name="message">The log message.</param>
public static void SubmitLog(this ExceptionlessClient client, string source, string message)
{
public static void SubmitLog(this ExceptionlessClient client, string source, string message) {
client.CreateLog(source, message).Submit();
}

Expand All @@ -66,8 +59,7 @@ public static void SubmitLog(this ExceptionlessClient client, string source, str
/// <param name="source">The log source.</param>
/// <param name="message">The log message.</param>
/// <param name="level">The log level.</param>
public static void SubmitLog(this ExceptionlessClient client, string source, string message, string level)
{
public static void SubmitLog(this ExceptionlessClient client, string source, string message, string level) {
client.CreateLog(source, message, level).Submit();
}

Expand All @@ -78,8 +70,7 @@ public static void SubmitLog(this ExceptionlessClient client, string source, str
/// <param name="source">The log source.</param>
/// <param name="message">The log message.</param>
/// <param name="level">The log level.</param>
public static void SubmitLog(this ExceptionlessClient client, string source, string message, LogLevel level)
{
public static void SubmitLog(this ExceptionlessClient client, string source, string message, LogLevel level) {
client.CreateLog(source, message, level.ToString()).Submit();
}

Expand All @@ -89,8 +80,7 @@ public static void SubmitLog(this ExceptionlessClient client, string source, str
/// <param name="client">The client instance.</param>
/// <param name="message">The log message.</param>
/// <param name="level">The log level.</param>
public static void SubmitLog(this ExceptionlessClient client, string message, LogLevel level)
{
public static void SubmitLog(this ExceptionlessClient client, string message, LogLevel level) {
client.CreateLog(null, message, level.ToString()).Submit();
}

Expand All @@ -99,8 +89,7 @@ public static void SubmitLog(this ExceptionlessClient client, string message, Lo
/// </summary>
/// <param name="client">The client instance.</param>
/// <param name="message">The log message.</param>
public static EventBuilder CreateLog(this ExceptionlessClient client, string message)
{
public static EventBuilder CreateLog(this ExceptionlessClient client, string message) {
return client.CreateEvent().SetType(Event.KnownTypes.Log).SetMessage(message);
}

Expand All @@ -110,8 +99,7 @@ public static EventBuilder CreateLog(this ExceptionlessClient client, string mes
/// <param name="client">The client instance.</param>
/// <param name="source">The log source.</param>
/// <param name="message">The log message.</param>
public static EventBuilder CreateLog(this ExceptionlessClient client, string source, string message)
{
public static EventBuilder CreateLog(this ExceptionlessClient client, string source, string message) {
return client.CreateLog(message).SetSource(source);
}

Expand All @@ -122,8 +110,7 @@ public static EventBuilder CreateLog(this ExceptionlessClient client, string sou
/// <param name="source">The log source.</param>
/// <param name="message">The log message.</param>
/// <param name="level">The log level.</param>
public static EventBuilder CreateLog(this ExceptionlessClient client, string source, string message, string level)
{
public static EventBuilder CreateLog(this ExceptionlessClient client, string source, string message, string level) {
var builder = client.CreateLog(source, message);

if (!String.IsNullOrWhiteSpace(level))
Expand All @@ -139,8 +126,7 @@ public static EventBuilder CreateLog(this ExceptionlessClient client, string sou
/// <param name="source">The log source.</param>
/// <param name="message">The log message.</param>
/// <param name="level">The log level.</param>
public static EventBuilder CreateLog(this ExceptionlessClient client, string source, string message, LogLevel level)
{
public static EventBuilder CreateLog(this ExceptionlessClient client, string source, string message, LogLevel level) {
return CreateLog(client, source, message, level.ToString());
}

Expand All @@ -150,8 +136,7 @@ public static EventBuilder CreateLog(this ExceptionlessClient client, string sou
/// <param name="client">The client instance.</param>S
/// <param name="message">The log message.</param>
/// <param name="level">The log level.</param>
public static EventBuilder CreateLog(this ExceptionlessClient client, string message, LogLevel level)
{
public static EventBuilder CreateLog(this ExceptionlessClient client, string message, LogLevel level) {
return CreateLog(client, null, message, level.ToString());
}

Expand All @@ -160,8 +145,7 @@ public static EventBuilder CreateLog(this ExceptionlessClient client, string mes
/// </summary>
/// <param name="client">The client instance.</param>
/// <param name="feature">The name of the feature that was used.</param>
public static EventBuilder CreateFeatureUsage(this ExceptionlessClient client, string feature)
{
public static EventBuilder CreateFeatureUsage(this ExceptionlessClient client, string feature) {
return client.CreateEvent().SetType(Event.KnownTypes.FeatureUsage).SetSource(feature);
}

Expand All @@ -170,8 +154,7 @@ public static EventBuilder CreateFeatureUsage(this ExceptionlessClient client, s
/// </summary>
/// <param name="client">The client instance.</param>
/// <param name="feature">The name of the feature that was used.</param>
public static void SubmitFeatureUsage(this ExceptionlessClient client, string feature)
{
public static void SubmitFeatureUsage(this ExceptionlessClient client, string feature) {
client.CreateFeatureUsage(feature).Submit();
}

Expand All @@ -180,8 +163,7 @@ public static void SubmitFeatureUsage(this ExceptionlessClient client, string fe
/// </summary>
/// <param name="client">The client instance.</param>
/// <param name="resource">The name of the resource that was not found.</param>
public static EventBuilder CreateNotFound(this ExceptionlessClient client, string resource)
{
public static EventBuilder CreateNotFound(this ExceptionlessClient client, string resource) {
return client.CreateEvent().SetType(Event.KnownTypes.NotFound).SetSource(resource);
}

Expand All @@ -190,62 +172,55 @@ public static EventBuilder CreateNotFound(this ExceptionlessClient client, strin
/// </summary>
/// <param name="client">The client instance.</param>
/// <param name="resource">The name of the resource that was not found.</param>
public static void SubmitNotFound(this ExceptionlessClient client, string resource)
{
public static void SubmitNotFound(this ExceptionlessClient client, string resource) {
client.CreateNotFound(resource).Submit();
}

/// <summary>
/// Creates a session start event.
/// </summary>
/// <param name="client">The client instance.</param>
public static EventBuilder CreateSessionStart(this ExceptionlessClient client)
{
public static EventBuilder CreateSessionStart(this ExceptionlessClient client) {
return client.CreateEvent().SetType(Event.KnownTypes.Session);
}

/// <summary>
/// Submits a session start event.
/// </summary>
/// <param name="client">The client instance.</param>
public static void SubmitSessionStart(this ExceptionlessClient client)
{
public static void SubmitSessionStart(this ExceptionlessClient client) {
client.CreateSessionStart().Submit();
}

/// <summary>
/// Creates a session end event.
/// </summary>
/// <param name="client">The client instance.</param>
public static EventBuilder CreateSessionEnd(this ExceptionlessClient client)
{
public static EventBuilder CreateSessionEnd(this ExceptionlessClient client) {
return client.CreateEvent().SetType(Event.KnownTypes.SessionEnd);
}

/// <summary>
/// Submits a session end event.
/// </summary>
/// <param name="client">The client instance.</param>
public static void SubmitSessionEnd(this ExceptionlessClient client)
{
public static void SubmitSessionEnd(this ExceptionlessClient client) {
client.CreateSessionEnd().Submit();
}

/// <summary>
/// Creates a session heartbeat event.
/// </summary>
/// <param name="client">The client instance.</param>
public static EventBuilder CreateSessionHeartbeat(this ExceptionlessClient client)
{
public static EventBuilder CreateSessionHeartbeat(this ExceptionlessClient client) {
return client.CreateEvent().SetType(Event.KnownTypes.SessionHeartbeat);
}

/// <summary>
/// Submits a session heartbeat event.
/// </summary>
/// <param name="client">The client instance.</param>
public static void SubmitSessionHeartbeat(this ExceptionlessClient client)
{
public static void SubmitSessionHeartbeat(this ExceptionlessClient client) {
client.CreateSessionHeartbeat().Submit();
}
}
Expand Down

0 comments on commit 0f59def

Please sign in to comment.