public static CommandLine AddMSBuildLoggers()

in TeamCity.CSharpInteractive.HostApi/DotNet/DotNetCommandLineExtensions.cs [43:60]


    public static CommandLine AddMSBuildLoggers(this CommandLine cmd, IHost host, DotNetVerbosity? verbosity = default)
    {
        var virtualContext = host.GetService<IVirtualContext>();
        var settings = host.GetService<IDotNetSettings>();

        if (settings.LoggersAreRequired == false)
        {
            return cmd;
        }

        return cmd
            .AddArgs("/noconsolelogger")
            .AddMSBuildArgs(("/l", $"TeamCity.MSBuild.Logger.TeamCityMSBuildLogger,{virtualContext.Resolve(settings.DotNetMSBuildLoggerDirectory)}/TeamCity.MSBuild.Logger.dll;TeamCity;plain"))
            .AddProps("-p",
                ("VSTestLogger", "logger://teamcity"),
                ("VSTestTestAdapterPath", virtualContext.Resolve(settings.DotNetVSTestLoggerDirectory)),
                ("VSTestVerbosity", (verbosity.HasValue ? (verbosity.Value >= DotNetVerbosity.Normal ? verbosity.Value : DotNetVerbosity.Normal) : DotNetVerbosity.Normal).ToString().ToLowerInvariant()));
    }