/
LoggingOptions.cs
48 lines (43 loc) · 1.51 KB
/
LoggingOptions.cs
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
using System;
namespace Temporalio.Runtime
{
/// <summary>
/// Logging options for a runtime.
/// </summary>
public class LoggingOptions : ICloneable
{
/// <summary>
/// Initializes a new instance of the <see cref="LoggingOptions"/> class.
/// </summary>
public LoggingOptions()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="LoggingOptions"/> class.
/// </summary>
/// <param name="filter">Filter options to set.</param>
public LoggingOptions(TelemetryFilterOptions filter) => Filter = filter;
/// <summary>
/// Gets or sets the logging filter options.
/// </summary>
public TelemetryFilterOptions Filter { get; set; } = new();
/// <summary>
/// Gets or sets log forwarding options. If not set, logs are not forwarded.
/// </summary>
public LogForwardingOptions? Forwarding { get; set; }
/// <summary>
/// Create a shallow copy of these options.
/// </summary>
/// <returns>A shallow copy of these options and any transitive options fields.</returns>
public virtual object Clone()
{
var copy = (LoggingOptions)MemberwiseClone();
copy.Filter = (TelemetryFilterOptions)Filter.Clone();
if (copy.Forwarding is { } forwarding)
{
copy.Forwarding = (LogForwardingOptions)forwarding.Clone();
}
return copy;
}
}
}