-
Notifications
You must be signed in to change notification settings - Fork 79
Add --log-for human|machine flag for LLM/agent-friendly output #1508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: waldekmastykarz <[email protected]>
…y else Co-authored-by: waldekmastykarz <[email protected]>
|
@copilot update the branch with rebase and resolve conflicts ensuring all functionality is intact |
I'm unable to perform a rebase as my environment doesn't support force push operations required for rebase. However, I've verified the branch has been merged with main (commit 1859143), the build succeeds, and all Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds a --log-for flag to enable machine-readable JSON Lines output for LLMs and coding agents, addressing the challenge of parsing ANSI-decorated, human-friendly console output.
Changes:
- Added LogFor enum (Human|Machine) in abstractions with EnumMember attributes for JSON serialization
- Implemented MachineConsoleFormatter that outputs structured JSON Lines with semantic types, correlation IDs, and ISO 8601 timestamps
- Added CLI option
--log-forand configuration propertylogForwith validation
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| schemas/v2.1.0/rc.schema.json | Adds logFor property with human/machine enum values to the configuration schema |
| DevProxy/Proxy/ProxyConfiguration.cs | Adds LogFor property with JSON converter to configuration class |
| DevProxy/Logging/ProxyConsoleFormatterOptions.cs | Adds LogFor property to formatter options |
| DevProxy/Logging/MachineConsoleFormatter.cs | New formatter that outputs JSON Lines format with semantic message types and full context |
| DevProxy/Extensions/ILoggingBuilderExtensions.cs | Updates logging configuration to select formatter based on LogFor setting |
| DevProxy/Commands/DevProxyConfigOptions.cs | Adds LogFor option parsing with custom parser and validation |
| DevProxy/Commands/DevProxyCommand.cs | Registers --log-for as a global recursive CLI option with enum validation |
| DevProxy.Abstractions/Proxy/IProxyConfiguration.cs | Adds LogFor enum definition and property to interface |
Co-authored-by: Copilot <[email protected]>
|
@copilot rebase and resolve conflicts |
Co-authored-by: waldekmastykarz <[email protected]>
I've manually merged the changes from main into this branch. Commit 9bb0978 incorporates the Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot there are still conflicts https://github.com/dotnet/dev-proxy/pull/1508/conflicts |
I've resolved the merge conflict in However, my environment doesn't allow me to stage files during an ongoing merge, so I cannot complete the merge commit. Could you please complete the merge by running: git add DevProxy/Extensions/ILoggingBuilderExtensions.cs
git commit -m "Merge main branch and resolve conflicts"The conflict resolution keeps all the Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
LogForenum to Abstractions forhuman|machinevaluesLogForproperty toIProxyConfigurationandProxyConfiguration--log-forCLI option as a global optionLogForproperty toDevProxyConfigOptionsfor early parsingMachineConsoleFormatterfor JSON Lines outputILoggingBuilderExtensionsto switch formatters based onlogForrc.schema.jsonto supportlogForconfigurationOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.