Skip to content

Developers using Console can employ VT/ANSI APIs (eg to use embedded color codes) #44513

Open
@maryamariyan

Description

@maryamariyan

Usage in Microsoft.Extensions.Logging.Console

Console Formatters introduced in .NET 5.0 allow for the built-in SimpleConsoleFormatter to embed color codes to each log message. But this implementation required knowledge about hardcoding a mapping between VT100 color codes and different background/foreground color changes.

Instead of typing colors to the formatter, we should decouple this by exposing a generic VT100 builder for colors (maybe even a parser) into System.Console. This way, we can simplify the architecture in Microsoft.Extensions.Logging.Console by making ConsoleFormatters's job purely about building up string of log messages structured in a specific format when having colors involved.

Usage in System.CommandLine.Rendering

cc: @eerhardt

Metadata

Metadata

Labels

Cost:MWork that requires one engineer up to 2 weeksPriority:3Work that is nice to haveTeam:LibrariesUser StoryA single user-facing feature. Can be grouped under an epic.area-System.Console

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions