Add ReCClientOptions for configurable logging behavior
Introduce the `ReCClientOptions` class in the new `ReC.Client` namespace. This class includes the `LogSuccessfulRequests` property, which allows users to enable or disable logging for successful API requests via the injected `ILogger`. Failed requests are unaffected and will always throw `ReCApiException`. The property defaults to `true`. XML documentation is included to describe the class and its behavior.
This commit is contained in:
16
src/ReC.Client/ReCClientOptions.cs
Normal file
16
src/ReC.Client/ReCClientOptions.cs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
namespace ReC.Client
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Options that control the behavior of the <see cref="ReCClient"/>.
|
||||||
|
/// </summary>
|
||||||
|
public class ReCClientOptions
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether successful API requests should be
|
||||||
|
/// logged through the injected <see cref="Microsoft.Extensions.Logging.ILogger"/>.
|
||||||
|
/// Failed requests always throw <see cref="ReCApiException"/> regardless of this setting.
|
||||||
|
/// Defaults to <see langword="true"/>.
|
||||||
|
/// </summary>
|
||||||
|
public bool LogSuccessfulRequests { get; set; } = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user