Skip to content

Commit

Permalink
Add back Guard.ThrowIfNull batch options (#4608)
Browse files Browse the repository at this point in the history
  • Loading branch information
alanwest committed Jun 22, 2023
1 parent be51a68 commit bd0d8d6
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/OpenTelemetry/Logs/LogRecordExportProcessorOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#nullable enable

using System.Diagnostics;
using OpenTelemetry.Internal;

namespace OpenTelemetry.Logs;

Expand All @@ -25,6 +26,8 @@ namespace OpenTelemetry.Logs;
/// </summary>
public class LogRecordExportProcessorOptions
{
private BatchExportLogRecordProcessorOptions batchExportProcessorOptions;

/// <summary>
/// Initializes a new instance of the <see cref="LogRecordExportProcessorOptions"/> class.
/// </summary>
Expand All @@ -38,7 +41,7 @@ public LogRecordExportProcessorOptions()
{
Debug.Assert(defaultBatchExportLogRecordProcessorOptions != null, "defaultBatchExportLogRecordProcessorOptions was null");

this.BatchExportProcessorOptions = defaultBatchExportLogRecordProcessorOptions ?? new();
this.batchExportProcessorOptions = defaultBatchExportLogRecordProcessorOptions ?? new();
}

/// <summary>
Expand All @@ -49,5 +52,13 @@ public LogRecordExportProcessorOptions()
/// <summary>
/// Gets or sets the batch export options. Ignored unless <see cref="ExportProcessorType"/> is <see cref="ExportProcessorType.Batch"/>.
/// </summary>
public BatchExportLogRecordProcessorOptions BatchExportProcessorOptions { get; set; }
public BatchExportLogRecordProcessorOptions BatchExportProcessorOptions
{
get => this.batchExportProcessorOptions;
set
{
Guard.ThrowIfNull(value);
this.batchExportProcessorOptions = value;
}
}
}

0 comments on commit bd0d8d6

Please sign in to comment.