/// <summary>
        /// Initializes a new instance of the <see cref="ReadonlyContextualDiagnosticReceiver{T}"/> class.
        /// </summary>
        /// <exception cref="ArgumentNullException"><paramref name="action"/> is <see langword="null"/>.</exception>
        public DiagnosticReceiver(DirectReportAction action)
        {
            if (action is null)
            {
                throw new ArgumentNullException(nameof(action));
            }

            _action = action;
        }
 /// <summary>
 /// Returns a new instance of the <see cref="DiagnosticReceiver"/> class.
 /// </summary>
 /// <param name="reportAction">Action that is performed when <see cref="DiagnosticReceiver.ReportDiagnostic(Diagnostic)"/>is called.</param>
 /// <exception cref="ArgumentNullException"><paramref name="reportAction"/> is <see langword="null"/>.</exception>
 public static DiagnosticReceiver Direct(DirectReportAction reportAction)
 {
     return(new DiagnosticReceiver(reportAction));
 }