Repository navigation
Expand file tree
/
Copy pathSentryLoggingOptions.cs
More file actions
53 lines (46 loc) · 1.7 KB
/
Copy pathSentryLoggingOptions.cs
File metadata and controls
53 lines (46 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using Microsoft.Extensions.Logging;
namespace Sentry.Extensions.Logging;
/// <summary>
/// Sentry logging integration options
/// </summary>
/// <inheritdoc />
public class SentryLoggingOptions : SentryOptions
{
/// <summary>
/// Gets or sets the minimum breadcrumb level.
/// </summary>
/// <remarks>
/// Events with this level or higher will be stored as <see cref="Breadcrumb"/>.
/// </remarks>
/// <value>
/// The minimum breadcrumb level.
/// </value>
public LogLevel MinimumBreadcrumbLevel { get; set; } = LogLevel.Information;
/// <summary>
/// Gets or sets the minimum event level.
/// </summary>
/// <remarks>
/// Events with this level or higher will be sent to Sentry.
/// </remarks>
/// <value>
/// The minimum event level.
/// </value>
public LogLevel MinimumEventLevel { get; set; } = LogLevel.Error;
/// <summary>
/// Whether to initialize this SDK through this integration
/// </summary>
public bool InitializeSdk { get; set; } = true;
/// <summary>
/// Add a callback to configure the scope upon SDK initialization
/// </summary>
/// <param name="action">The function to invoke when initializing the SDK</param>
public void ConfigureScope(Action<Scope> action) => ConfigureScopeCallbacks = ConfigureScopeCallbacks.Concat(new[] { action }).ToArray();
/// <summary>
/// Log entry filters
/// </summary>
internal ILogEntryFilter[] Filters { get; set; } = Array.Empty<ILogEntryFilter>();
/// <summary>
/// List of callbacks to be invoked when initializing the SDK
/// </summary>
internal Action<Scope>[] ConfigureScopeCallbacks { get; set; } = Array.Empty<Action<Scope>>();
}