2
2
using Exceptionless . Logging ;
3
3
using Exceptionless . Models ;
4
4
5
- namespace Exceptionless
6
- {
7
- public static class ClientExtensions
8
- {
5
+ namespace Exceptionless {
6
+ public static class ClientExtensions {
9
7
/// <summary>
10
8
/// Submits an unhandled exception event.
11
9
/// </summary>
12
10
/// <param name="client">The client instance.</param>
13
11
/// <param name="exception">The unhandled exception.</param>
14
- public static void SubmitUnhandledException ( this ExceptionlessClient client , Exception exception )
15
- {
12
+ public static void SubmitUnhandledException ( this ExceptionlessClient client , Exception exception ) {
16
13
var builder = exception . ToExceptionless ( client : client ) ;
17
14
builder . PluginContextData . MarkAsUnhandledError ( ) ;
18
15
builder . Submit ( ) ;
@@ -23,8 +20,7 @@ public static void SubmitUnhandledException(this ExceptionlessClient client, Exc
23
20
/// </summary>
24
21
/// <param name="client">The client instance.</param>
25
22
/// <param name="exception">The exception.</param>
26
- public static void SubmitException ( this ExceptionlessClient client , Exception exception )
27
- {
23
+ public static void SubmitException ( this ExceptionlessClient client , Exception exception ) {
28
24
client . CreateException ( exception ) . Submit ( ) ;
29
25
}
30
26
@@ -33,8 +29,7 @@ public static void SubmitException(this ExceptionlessClient client, Exception ex
33
29
/// </summary>
34
30
/// <param name="client">The client instance.</param>
35
31
/// <param name="exception">The exception.</param>
36
- public static EventBuilder CreateException ( this ExceptionlessClient client , Exception exception )
37
- {
32
+ public static EventBuilder CreateException ( this ExceptionlessClient client , Exception exception ) {
38
33
return exception . ToExceptionless ( client : client ) ;
39
34
}
40
35
@@ -43,8 +38,7 @@ public static EventBuilder CreateException(this ExceptionlessClient client, Exce
43
38
/// </summary>
44
39
/// <param name="client">The client instance.</param>
45
40
/// <param name="message">The log message.</param>
46
- public static void SubmitLog ( this ExceptionlessClient client , string message )
47
- {
41
+ public static void SubmitLog ( this ExceptionlessClient client , string message ) {
48
42
client . CreateLog ( message ) . Submit ( ) ;
49
43
}
50
44
@@ -54,8 +48,7 @@ public static void SubmitLog(this ExceptionlessClient client, string message)
54
48
/// <param name="client">The client instance.</param>
55
49
/// <param name="source">The log source.</param>
56
50
/// <param name="message">The log message.</param>
57
- public static void SubmitLog ( this ExceptionlessClient client , string source , string message )
58
- {
51
+ public static void SubmitLog ( this ExceptionlessClient client , string source , string message ) {
59
52
client . CreateLog ( source , message ) . Submit ( ) ;
60
53
}
61
54
@@ -66,8 +59,7 @@ public static void SubmitLog(this ExceptionlessClient client, string source, str
66
59
/// <param name="source">The log source.</param>
67
60
/// <param name="message">The log message.</param>
68
61
/// <param name="level">The log level.</param>
69
- public static void SubmitLog ( this ExceptionlessClient client , string source , string message , string level )
70
- {
62
+ public static void SubmitLog ( this ExceptionlessClient client , string source , string message , string level ) {
71
63
client . CreateLog ( source , message , level ) . Submit ( ) ;
72
64
}
73
65
@@ -78,8 +70,7 @@ public static void SubmitLog(this ExceptionlessClient client, string source, str
78
70
/// <param name="source">The log source.</param>
79
71
/// <param name="message">The log message.</param>
80
72
/// <param name="level">The log level.</param>
81
- public static void SubmitLog ( this ExceptionlessClient client , string source , string message , LogLevel level )
82
- {
73
+ public static void SubmitLog ( this ExceptionlessClient client , string source , string message , LogLevel level ) {
83
74
client . CreateLog ( source , message , level . ToString ( ) ) . Submit ( ) ;
84
75
}
85
76
@@ -89,8 +80,7 @@ public static void SubmitLog(this ExceptionlessClient client, string source, str
89
80
/// <param name="client">The client instance.</param>
90
81
/// <param name="message">The log message.</param>
91
82
/// <param name="level">The log level.</param>
92
- public static void SubmitLog ( this ExceptionlessClient client , string message , LogLevel level )
93
- {
83
+ public static void SubmitLog ( this ExceptionlessClient client , string message , LogLevel level ) {
94
84
client . CreateLog ( null , message , level . ToString ( ) ) . Submit ( ) ;
95
85
}
96
86
@@ -99,8 +89,7 @@ public static void SubmitLog(this ExceptionlessClient client, string message, Lo
99
89
/// </summary>
100
90
/// <param name="client">The client instance.</param>
101
91
/// <param name="message">The log message.</param>
102
- public static EventBuilder CreateLog ( this ExceptionlessClient client , string message )
103
- {
92
+ public static EventBuilder CreateLog ( this ExceptionlessClient client , string message ) {
104
93
return client . CreateEvent ( ) . SetType ( Event . KnownTypes . Log ) . SetMessage ( message ) ;
105
94
}
106
95
@@ -110,8 +99,7 @@ public static EventBuilder CreateLog(this ExceptionlessClient client, string mes
110
99
/// <param name="client">The client instance.</param>
111
100
/// <param name="source">The log source.</param>
112
101
/// <param name="message">The log message.</param>
113
- public static EventBuilder CreateLog ( this ExceptionlessClient client , string source , string message )
114
- {
102
+ public static EventBuilder CreateLog ( this ExceptionlessClient client , string source , string message ) {
115
103
return client . CreateLog ( message ) . SetSource ( source ) ;
116
104
}
117
105
@@ -122,8 +110,7 @@ public static EventBuilder CreateLog(this ExceptionlessClient client, string sou
122
110
/// <param name="source">The log source.</param>
123
111
/// <param name="message">The log message.</param>
124
112
/// <param name="level">The log level.</param>
125
- public static EventBuilder CreateLog ( this ExceptionlessClient client , string source , string message , string level )
126
- {
113
+ public static EventBuilder CreateLog ( this ExceptionlessClient client , string source , string message , string level ) {
127
114
var builder = client . CreateLog ( source , message ) ;
128
115
129
116
if ( ! String . IsNullOrWhiteSpace ( level ) )
@@ -139,8 +126,7 @@ public static EventBuilder CreateLog(this ExceptionlessClient client, string sou
139
126
/// <param name="source">The log source.</param>
140
127
/// <param name="message">The log message.</param>
141
128
/// <param name="level">The log level.</param>
142
- public static EventBuilder CreateLog ( this ExceptionlessClient client , string source , string message , LogLevel level )
143
- {
129
+ public static EventBuilder CreateLog ( this ExceptionlessClient client , string source , string message , LogLevel level ) {
144
130
return CreateLog ( client , source , message , level . ToString ( ) ) ;
145
131
}
146
132
@@ -150,8 +136,7 @@ public static EventBuilder CreateLog(this ExceptionlessClient client, string sou
150
136
/// <param name="client">The client instance.</param>S
151
137
/// <param name="message">The log message.</param>
152
138
/// <param name="level">The log level.</param>
153
- public static EventBuilder CreateLog ( this ExceptionlessClient client , string message , LogLevel level )
154
- {
139
+ public static EventBuilder CreateLog ( this ExceptionlessClient client , string message , LogLevel level ) {
155
140
return CreateLog ( client , null , message , level . ToString ( ) ) ;
156
141
}
157
142
@@ -160,8 +145,7 @@ public static EventBuilder CreateLog(this ExceptionlessClient client, string mes
160
145
/// </summary>
161
146
/// <param name="client">The client instance.</param>
162
147
/// <param name="feature">The name of the feature that was used.</param>
163
- public static EventBuilder CreateFeatureUsage ( this ExceptionlessClient client , string feature )
164
- {
148
+ public static EventBuilder CreateFeatureUsage ( this ExceptionlessClient client , string feature ) {
165
149
return client . CreateEvent ( ) . SetType ( Event . KnownTypes . FeatureUsage ) . SetSource ( feature ) ;
166
150
}
167
151
@@ -170,8 +154,7 @@ public static EventBuilder CreateFeatureUsage(this ExceptionlessClient client, s
170
154
/// </summary>
171
155
/// <param name="client">The client instance.</param>
172
156
/// <param name="feature">The name of the feature that was used.</param>
173
- public static void SubmitFeatureUsage ( this ExceptionlessClient client , string feature )
174
- {
157
+ public static void SubmitFeatureUsage ( this ExceptionlessClient client , string feature ) {
175
158
client . CreateFeatureUsage ( feature ) . Submit ( ) ;
176
159
}
177
160
@@ -180,8 +163,7 @@ public static void SubmitFeatureUsage(this ExceptionlessClient client, string fe
180
163
/// </summary>
181
164
/// <param name="client">The client instance.</param>
182
165
/// <param name="resource">The name of the resource that was not found.</param>
183
- public static EventBuilder CreateNotFound ( this ExceptionlessClient client , string resource )
184
- {
166
+ public static EventBuilder CreateNotFound ( this ExceptionlessClient client , string resource ) {
185
167
return client . CreateEvent ( ) . SetType ( Event . KnownTypes . NotFound ) . SetSource ( resource ) ;
186
168
}
187
169
@@ -190,62 +172,55 @@ public static EventBuilder CreateNotFound(this ExceptionlessClient client, strin
190
172
/// </summary>
191
173
/// <param name="client">The client instance.</param>
192
174
/// <param name="resource">The name of the resource that was not found.</param>
193
- public static void SubmitNotFound ( this ExceptionlessClient client , string resource )
194
- {
175
+ public static void SubmitNotFound ( this ExceptionlessClient client , string resource ) {
195
176
client . CreateNotFound ( resource ) . Submit ( ) ;
196
177
}
197
178
198
179
/// <summary>
199
180
/// Creates a session start event.
200
181
/// </summary>
201
182
/// <param name="client">The client instance.</param>
202
- public static EventBuilder CreateSessionStart ( this ExceptionlessClient client )
203
- {
183
+ public static EventBuilder CreateSessionStart ( this ExceptionlessClient client ) {
204
184
return client . CreateEvent ( ) . SetType ( Event . KnownTypes . Session ) ;
205
185
}
206
186
207
187
/// <summary>
208
188
/// Submits a session start event.
209
189
/// </summary>
210
190
/// <param name="client">The client instance.</param>
211
- public static void SubmitSessionStart ( this ExceptionlessClient client )
212
- {
191
+ public static void SubmitSessionStart ( this ExceptionlessClient client ) {
213
192
client . CreateSessionStart ( ) . Submit ( ) ;
214
193
}
215
194
216
195
/// <summary>
217
196
/// Creates a session end event.
218
197
/// </summary>
219
198
/// <param name="client">The client instance.</param>
220
- public static EventBuilder CreateSessionEnd ( this ExceptionlessClient client )
221
- {
199
+ public static EventBuilder CreateSessionEnd ( this ExceptionlessClient client ) {
222
200
return client . CreateEvent ( ) . SetType ( Event . KnownTypes . SessionEnd ) ;
223
201
}
224
202
225
203
/// <summary>
226
204
/// Submits a session end event.
227
205
/// </summary>
228
206
/// <param name="client">The client instance.</param>
229
- public static void SubmitSessionEnd ( this ExceptionlessClient client )
230
- {
207
+ public static void SubmitSessionEnd ( this ExceptionlessClient client ) {
231
208
client . CreateSessionEnd ( ) . Submit ( ) ;
232
209
}
233
210
234
211
/// <summary>
235
212
/// Creates a session heartbeat event.
236
213
/// </summary>
237
214
/// <param name="client">The client instance.</param>
238
- public static EventBuilder CreateSessionHeartbeat ( this ExceptionlessClient client )
239
- {
215
+ public static EventBuilder CreateSessionHeartbeat ( this ExceptionlessClient client ) {
240
216
return client . CreateEvent ( ) . SetType ( Event . KnownTypes . SessionHeartbeat ) ;
241
217
}
242
218
243
219
/// <summary>
244
220
/// Submits a session heartbeat event.
245
221
/// </summary>
246
222
/// <param name="client">The client instance.</param>
247
- public static void SubmitSessionHeartbeat ( this ExceptionlessClient client )
248
- {
223
+ public static void SubmitSessionHeartbeat ( this ExceptionlessClient client ) {
249
224
client . CreateSessionHeartbeat ( ) . Submit ( ) ;
250
225
}
251
226
}
0 commit comments