From 60d59af4698d6069299e918384c6842d821e05ea Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 19 Jan 2026 11:54:46 +0000 Subject: [PATCH 1/6] Initial plan From 4f38ff52c1ff77db286e3fd499b5a8c6634c6e4e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 19 Jan 2026 12:06:05 +0000 Subject: [PATCH 2/6] Add --log-for human|machine flag for LLM/agent-friendly output Co-authored-by: waldekmastykarz <11164679+waldekmastykarz@users.noreply.github.com> --- .../Proxy/IProxyConfiguration.cs | 9 + DevProxy/Commands/DevProxyCommand.cs | 16 ++ DevProxy/Commands/DevProxyConfigOptions.cs | 24 +++ .../Extensions/ILoggingBuilderExtensions.cs | 36 +++- DevProxy/Logging/MachineConsoleFormatter.cs | 193 ++++++++++++++++++ .../Logging/ProxyConsoleFormatterOptions.cs | 3 + DevProxy/Proxy/ProxyConfiguration.cs | 2 + schemas/v2.1.0/rc.schema.json | 8 + 8 files changed, 284 insertions(+), 7 deletions(-) create mode 100644 DevProxy/Logging/MachineConsoleFormatter.cs diff --git a/DevProxy.Abstractions/Proxy/IProxyConfiguration.cs b/DevProxy.Abstractions/Proxy/IProxyConfiguration.cs index ab6d084f..6171dccd 100644 --- a/DevProxy.Abstractions/Proxy/IProxyConfiguration.cs +++ b/DevProxy.Abstractions/Proxy/IProxyConfiguration.cs @@ -18,6 +18,14 @@ public enum ReleaseType Beta } +public enum LogFor +{ + [EnumMember(Value = "human")] + Human, + [EnumMember(Value = "machine")] + Machine +} + public interface IProxyConfiguration { int ApiPort { get; set; } @@ -29,6 +37,7 @@ public interface IProxyConfiguration IEnumerable? FilterByHeaders { get; } bool InstallCert { get; set; } string? IPAddress { get; set; } + LogFor LogFor { get; } LogLevel LogLevel { get; } ReleaseType NewVersionNotification { get; } bool NoFirstRun { get; set; } diff --git a/DevProxy/Commands/DevProxyCommand.cs b/DevProxy/Commands/DevProxyCommand.cs index e3db039b..8d297373 100644 --- a/DevProxy/Commands/DevProxyCommand.cs +++ b/DevProxy/Commands/DevProxyCommand.cs @@ -37,6 +37,7 @@ sealed class DevProxyCommand : RootCommand internal const string TimeoutOptionName = "--timeout"; internal const string DiscoverOptionName = "--discover"; internal const string EnvOptionName = "--env"; + internal const string LogForOptionName = "--log-for"; private static readonly string[] globalOptions = ["--version"]; private static readonly string[] helpOptions = ["--help", "-h", "/h", "-?", "/?"]; @@ -353,6 +354,20 @@ private void ConfigureCommand() } }); + var logForOption = new Option(LogForOptionName) + { + Description = $"Target audience for log output. Allowed values: {string.Join(", ", Enum.GetNames())}", + HelpName = "log-for", + Recursive = true + }; + logForOption.Validators.Add(input => + { + if (!Enum.TryParse(input.Tokens[0].Value, true, out _)) + { + input.AddError($"{input.Tokens[0].Value} is not a valid log-for value. Allowed values are: {string.Join(", ", Enum.GetNames())}"); + } + }); + var options = new List