Add FormatterOverride trait for alternative output formats (JSON, structured logs)#134
Merged
Merged
Conversation
…tion Co-authored-by: josecelano <58816+josecelano@users.noreply.github.com>
Co-authored-by: josecelano <58816+josecelano@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add formatter override support for alternative output formats
Add FormatterOverride trait for alternative output formats (JSON, structured logs)
Nov 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds optional post-processing of formatted messages to enable machine-readable outputs (JSON, structured logs, ANSI colors) without modifying individual message types. Extends the trait-based architecture (issue #102) while preserving theme-based formatting as the primary mechanism.
Changes
Core trait and integration:
FormatterOverridetrait for transforming already-formatted messagesOutputMessagetrait withtype_name()method for metadata extractionformatter_overridefield toUserOutput(defaults toNonefor backward compatibility)write()to apply override after theme formatting when presentExample implementation:
JsonFormatterproducing JSON with type, channel, content, and ISO 8601 timestampwith_formatter_override()andwith_theme_and_formatter()Testing:
Usage
Notes
formatter_overridetoNoneWarning
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:
192.0.2.1ssh -i /nonexistent/key -p 22 -o StrictHostKeyChecking=no -o ConnectTimeout=5 -o UserKnownHostsFile=/dev/null testuser@192.0.2.1 echo 'SSH connected'(packet block)If you need me to access, download, or install something from one of these locations, you can either:
Original 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.