feat(cli): disable distributed context propagation

This commit is contained in:
genteure 2024-07-05 18:24:08 +08:00
parent 2ed57ec9ac
commit 5f047d4e4a

View File

@ -2,6 +2,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.CommandLine; using System.CommandLine;
using System.CommandLine.NamingConventionBinder; using System.CommandLine.NamingConventionBinder;
using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
@ -44,6 +45,10 @@ namespace BililiveRecorder.Cli
{ {
ConsoleModeHelper.SetQuickEditMode(false); ConsoleModeHelper.SetQuickEditMode(false);
} }
DistributedContextPropagator.Current = DistributedContextPropagator.CreateNoOutputPropagator();
AppContext.SetSwitch("System.Net.Http.EnableActivityPropagation", false);
RootCommand root; RootCommand root;
using (var entrypointLogger = BuildLogger(LogEventLevel.Fatal, LogEventLevel.Verbose)) using (var entrypointLogger = BuildLogger(LogEventLevel.Fatal, LogEventLevel.Verbose))