28 var channel = @event.Diagnostic.Level
switch
30 DiagnosticLevel.Trace => _options.TraceChannel,
31 DiagnosticLevel.Info => _options.InfoChannel,
32 DiagnosticLevel.Warning => _options.WarningChannel,
33 DiagnosticLevel.Error => _options.ErrorChannel,
34 DiagnosticLevel.Fatal => _options.FatalChannel,
35 _ =>
throw new InvalidOperationException(),
57 var hs =
new HashSet<IDisposable>();
59 if (_options.TraceChannel is IDisposable trace && hs.Add(trace))
61 if (_options.InfoChannel is IDisposable info && hs.Add(info))
63 if (_options.WarningChannel is IDisposable warning && hs.Add(warning))
65 if (_options.ErrorChannel is IDisposable error && hs.Add(error))
67 if (_options.FatalChannel is IDisposable fatal && hs.Add(fatal))