-
Notifications
You must be signed in to change notification settings - Fork 3
/
ResponseLoggingConfiguration.cs
34 lines (31 loc) · 1.49 KB
/
ResponseLoggingConfiguration.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
using System.Collections.Generic;
using System.Linq;
namespace APIMatic.Core.Utilities.Logger.Configuration
{
/// <summary>
/// Represents the configuration settings for logging HTTP responses.
/// </summary>
public class ResponseLoggingConfiguration : HttpLoggingConfiguration
{
private ResponseLoggingConfiguration(bool body, bool headers, IReadOnlyCollection<string> headersToInclude,
IReadOnlyCollection<string> headersToExclude, IReadOnlyCollection<string> headersToUnmask) : base(body,
headers, headersToInclude, headersToExclude, headersToUnmask)
{
}
public static ResponseLoggingConfiguration Default() =>
new ResponseLoggingConfiguration(
false,
false,
Enumerable.Empty<string>().ToList(),
Enumerable.Empty<string>().ToList(),
Enumerable.Empty<string>().ToList());
public static ResponseLoggingConfiguration Builder(bool logBody, bool logHeaders,
IReadOnlyCollection<string> headersToInclude, IReadOnlyCollection<string> headersToExclude,
IReadOnlyCollection<string> headersToUnmask) =>
new ResponseLoggingConfiguration(logBody,
logHeaders,
headersToInclude ?? Enumerable.Empty<string>().ToList(),
headersToExclude ?? Enumerable.Empty<string>().ToList(),
headersToUnmask ?? Enumerable.Empty<string>().ToList());
}
}