650 references to ConsoleColor
AnalyzerRunner (29)
DiagnosticAnalyzerRunner.cs (26)
385WriteLine($"Running analyzers for {project.Name}", ConsoleColor.Gray);
402WriteLine($"Failed to analyze {project.Name} with {e.ToString()}", ConsoleColor.Red);
435WriteLine($"Execution times (ms):", ConsoleColor.DarkCyan);
445WriteLine($"Statistics for {analyzerName}:", ConsoleColor.DarkCyan);
446WriteLine($"Concurrent: {telemetry.Concurrent}", telemetry.Concurrent ? ConsoleColor.White : ConsoleColor.DarkRed);
447WriteLine($"Execution time (ms): {telemetry.ExecutionTime.TotalMilliseconds}", ConsoleColor.White);
449WriteLine($"Code Block Actions: {telemetry.CodeBlockActionsCount}", ConsoleColor.White);
450WriteLine($"Code Block Start Actions: {telemetry.CodeBlockStartActionsCount}", ConsoleColor.White);
451WriteLine($"Code Block End Actions: {telemetry.CodeBlockEndActionsCount}", ConsoleColor.White);
453WriteLine($"Compilation Actions: {telemetry.CompilationActionsCount}", ConsoleColor.White);
454WriteLine($"Compilation Start Actions: {telemetry.CompilationStartActionsCount}", ConsoleColor.White);
455WriteLine($"Compilation End Actions: {telemetry.CompilationEndActionsCount}", ConsoleColor.White);
457WriteLine($"Operation Actions: {telemetry.OperationActionsCount}", ConsoleColor.White);
458WriteLine($"Operation Block Actions: {telemetry.OperationBlockActionsCount}", ConsoleColor.White);
459WriteLine($"Operation Block Start Actions: {telemetry.OperationBlockStartActionsCount}", ConsoleColor.White);
460WriteLine($"Operation Block End Actions: {telemetry.OperationBlockEndActionsCount}", ConsoleColor.White);
462WriteLine($"Semantic Model Actions: {telemetry.SemanticModelActionsCount}", ConsoleColor.White);
463WriteLine($"Symbol Actions: {telemetry.SymbolActionsCount}", ConsoleColor.White);
464WriteLine($"Symbol Start Actions: {telemetry.SymbolStartActionsCount}", ConsoleColor.White);
465WriteLine($"Symbol End Actions: {telemetry.SymbolEndActionsCount}", ConsoleColor.White);
466WriteLine($"Syntax Node Actions: {telemetry.SyntaxNodeActionsCount}", ConsoleColor.White);
467WriteLine($"Syntax Tree Actions: {telemetry.SyntaxTreeActionsCount}", ConsoleColor.White);
468WriteLine($"Additional File Actions: {telemetry.AdditionalFileActionsCount}", ConsoleColor.White);
470WriteLine($"Suppression Actions: {telemetry.SuppressionActionsCount}", ConsoleColor.White);
476WriteLine($"{analyzerName}:{padding} {telemetry.ExecutionTime.TotalMilliseconds,7:0}", ConsoleColor.White);
Aspire.Dashboard (36)
ConsoleLogs\AnsiParser.cs (36)
519ConsoleColor.Black => state.Bright ? "ansi-fg-brightblack" : "ansi-fg-black",
520ConsoleColor.Blue => state.Bright ? "ansi-fg-brightblue" : "ansi-fg-blue",
521ConsoleColor.Cyan => state.Bright ? "ansi-fg-brightcyan" : "ansi-fg-cyan",
522ConsoleColor.Green => state.Bright ? "ansi-fg-brightgreen" : "ansi-fg-green",
523ConsoleColor.Magenta => state.Bright ? "ansi-fg-brightmagenta" : "ansi-fg-magenta",
524ConsoleColor.Red => state.Bright ? "ansi-fg-brightred" : "ansi-fg-red",
525ConsoleColor.White => state.Bright ? "ansi-fg-brightwhite" : "ansi-fg-white",
526ConsoleColor.Yellow => state.Bright ? "ansi-fg-brightyellow" : "ansi-fg-yellow",
535ConsoleColor.Black => "ansi-bg-black",
536ConsoleColor.Blue => "ansi-bg-blue",
537ConsoleColor.Cyan => "ansi-bg-cyan",
538ConsoleColor.Green => "ansi-bg-green",
539ConsoleColor.Magenta => "ansi-bg-magenta",
540ConsoleColor.Red => "ansi-bg-red",
541ConsoleColor.White => "ansi-bg-white",
542ConsoleColor.Yellow => "ansi-bg-yellow",
547private static bool TryGetForegroundColor(int number, out ConsoleColor? color)
55130 => ConsoleColor.Black,
55231 => ConsoleColor.Red,
55332 => ConsoleColor.Green,
55433 => ConsoleColor.Yellow,
55534 => ConsoleColor.Blue,
55635 => ConsoleColor.Magenta,
55736 => ConsoleColor.Cyan,
55837 => ConsoleColor.White,
564private static bool TryGetBackgroundColor(int number, out ConsoleColor? color)
56840 => ConsoleColor.Black,
56941 => ConsoleColor.Red,
57042 => ConsoleColor.Green,
57143 => ConsoleColor.Yellow,
57244 => ConsoleColor.Blue,
57345 => ConsoleColor.Magenta,
57446 => ConsoleColor.Cyan,
57547 => ConsoleColor.White,
861public ConsoleColor? ForegroundColor { get; set; }
862public ConsoleColor? BackgroundColor { get; set; }
Aspire.Dashboard.Tests (8)
ClientSample (12)
dotnet-dev-certs (18)
dotnet-getdocument (18)
dotnet-openapi (18)
dotnet-sql-cache (18)
dotnet-svcutil-lib (3)
dotnet-user-jwts (18)
dotnet-user-secrets (18)
GetDocument.Insider (18)
HttpStress (8)
InProcessWebSite (1)
Microsoft.Arcade.Common (41)
CompactConsoleLoggerFormatter.cs (41)
115private (ConsoleColor? Foreground, ConsoleColor? Background) GetLogLevelConsoleColors(LogLevel logLevel)
126LogLevel.Trace => (ConsoleColor.Gray, ConsoleColor.Black),
127LogLevel.Debug => (ConsoleColor.Gray, ConsoleColor.Black),
128LogLevel.Information => (ConsoleColor.DarkGreen, ConsoleColor.Black),
129LogLevel.Warning => (ConsoleColor.Yellow, ConsoleColor.Black),
130LogLevel.Error => (ConsoleColor.Black, ConsoleColor.DarkRed),
131LogLevel.Critical => (ConsoleColor.White, ConsoleColor.DarkRed),
136private static void WriteColoredMessage(TextWriter textWriter, string message, ConsoleColor? background, ConsoleColor? foreground)
162private static string GetForegroundColorEscapeCode(ConsoleColor color) => color switch
164ConsoleColor.Black => "\x1B[30m",
165ConsoleColor.DarkRed => "\x1B[31m",
166ConsoleColor.DarkGreen => "\x1B[32m",
167ConsoleColor.DarkYellow => "\x1B[33m",
168ConsoleColor.DarkBlue => "\x1B[34m",
169ConsoleColor.DarkMagenta => "\x1B[35m",
170ConsoleColor.DarkCyan => "\x1B[36m",
171ConsoleColor.Gray => "\x1B[37m",
172ConsoleColor.Red => "\x1B[1m\x1B[31m",
173ConsoleColor.Green => "\x1B[1m\x1B[32m",
174ConsoleColor.Yellow => "\x1B[1m\x1B[33m",
175ConsoleColor.Blue => "\x1B[1m\x1B[34m",
176ConsoleColor.Magenta => "\x1B[1m\x1B[35m",
177ConsoleColor.Cyan => "\x1B[1m\x1B[36m",
178ConsoleColor.White => "\x1B[1m\x1B[37m",
182private static string GetBackgroundColorEscapeCode(ConsoleColor color) => color switch
184ConsoleColor.Black => "\x1B[40m",
185ConsoleColor.DarkRed => "\x1B[41m",
186ConsoleColor.DarkGreen => "\x1B[42m",
187ConsoleColor.DarkYellow => "\x1B[43m",
188ConsoleColor.DarkBlue => "\x1B[44m",
189ConsoleColor.DarkMagenta => "\x1B[45m",
190ConsoleColor.DarkCyan => "\x1B[46m",
191ConsoleColor.Gray => "\x1B[47m",
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (1)
Microsoft.AspNetCore.Shared.Tests (12)
Microsoft.Build (97)
Microsoft.Build.Engine.UnitTests (6)
Microsoft.CodeAnalysis.Scripting (5)
Microsoft.CodeAnalysis.Scripting.TestUtilities (5)
Microsoft.CodeAnalysis.Workspaces.UnitTests (3)
Microsoft.DotNet.Open.Api.Tools.Tests (1)
Microsoft.DotNet.SignCheckLibrary (2)
Microsoft.DotNet.VersionTools.Cli (2)
Microsoft.Extensions.ApiDescription.Tool.Tests (1)
Microsoft.Extensions.Logging.Console (81)
AnsiParser.cs (57)
12private readonly Action<string, int, int, ConsoleColor?, ConsoleColor?> _onParseWrite;
13public AnsiParser(Action<string, int, int, ConsoleColor?, ConsoleColor?> onParseWrite)
50ConsoleColor? foreground = null;
51ConsoleColor? background = null;
54ConsoleColor? color = null;
133internal static string GetForegroundColorEscapeCode(ConsoleColor color)
137ConsoleColor.Black => "\e[30m",
138ConsoleColor.DarkRed => "\e[31m",
139ConsoleColor.DarkGreen => "\e[32m",
140ConsoleColor.DarkYellow => "\e[33m",
141ConsoleColor.DarkBlue => "\e[34m",
142ConsoleColor.DarkMagenta => "\e[35m",
143ConsoleColor.DarkCyan => "\e[36m",
144ConsoleColor.Gray => "\e[37m",
145ConsoleColor.Red => "\e[1m\e[31m",
146ConsoleColor.Green => "\e[1m\e[32m",
147ConsoleColor.Yellow => "\e[1m\e[33m",
148ConsoleColor.Blue => "\e[1m\e[34m",
149ConsoleColor.Magenta => "\e[1m\e[35m",
150ConsoleColor.Cyan => "\e[1m\e[36m",
151ConsoleColor.White => "\e[1m\e[37m",
156internal static string GetBackgroundColorEscapeCode(ConsoleColor color)
160ConsoleColor.Black => "\e[40m",
161ConsoleColor.DarkRed => "\e[41m",
162ConsoleColor.DarkGreen => "\e[42m",
163ConsoleColor.DarkYellow => "\e[43m",
164ConsoleColor.DarkBlue => "\e[44m",
165ConsoleColor.DarkMagenta => "\e[45m",
166ConsoleColor.DarkCyan => "\e[46m",
167ConsoleColor.Gray => "\e[47m",
172private static bool TryGetForegroundColor(int number, bool isBright, out ConsoleColor? color)
17630 => ConsoleColor.Black,
17731 => isBright ? ConsoleColor.Red : ConsoleColor.DarkRed,
17832 => isBright ? ConsoleColor.Green : ConsoleColor.DarkGreen,
17933 => isBright ? ConsoleColor.Yellow : ConsoleColor.DarkYellow,
18034 => isBright ? ConsoleColor.Blue : ConsoleColor.DarkBlue,
18135 => isBright ? ConsoleColor.Magenta : ConsoleColor.DarkMagenta,
18236 => isBright ? ConsoleColor.Cyan : ConsoleColor.DarkCyan,
18337 => isBright ? ConsoleColor.White : ConsoleColor.Gray,
189private static bool TryGetBackgroundColor(int number, out ConsoleColor? color)
19340 => ConsoleColor.Black,
19441 => ConsoleColor.DarkRed,
19542 => ConsoleColor.DarkGreen,
19643 => ConsoleColor.DarkYellow,
19744 => ConsoleColor.DarkBlue,
19845 => ConsoleColor.DarkMagenta,
19946 => ConsoleColor.DarkCyan,
20047 => ConsoleColor.Gray,
SimpleConsoleFormatter.cs (16)
191LogLevel.Trace => new ConsoleColors(ConsoleColor.Gray, ConsoleColor.Black),
192LogLevel.Debug => new ConsoleColors(ConsoleColor.Gray, ConsoleColor.Black),
193LogLevel.Information => new ConsoleColors(ConsoleColor.DarkGreen, ConsoleColor.Black),
194LogLevel.Warning => new ConsoleColors(ConsoleColor.Yellow, ConsoleColor.Black),
195LogLevel.Error => new ConsoleColors(ConsoleColor.Black, ConsoleColor.DarkRed),
196LogLevel.Critical => new ConsoleColors(ConsoleColor.White, ConsoleColor.DarkRed),
230public ConsoleColors(ConsoleColor? foreground, ConsoleColor? background)
236public ConsoleColor? Foreground { get; }
238public ConsoleColor? Background { get; }
Microsoft.Extensions.SecretManager.Tools.Tests (1)
Microsoft.ML.Core (5)
mscorlib (1)
netstandard (1)
RunTests (13)
Swaggatherer (12)
System.Console (16)
System\Console.cs (7)
322internal const ConsoleColor UnknownColor = (ConsoleColor)(-1);
328public static ConsoleColor BackgroundColor
338public static ConsoleColor ForegroundColor
528ConsolePal.MoveBufferArea(sourceLeft, sourceTop, sourceWidth, sourceHeight, targetLeft, targetTop, ' ', ConsoleColor.Black, BackgroundColor);
532public static void MoveBufferArea(int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop, char sourceChar, ConsoleColor sourceForeColor, ConsoleColor sourceBackColor)
System\ConsolePal.Unix.cs (9)
156private static ConsoleColor s_trackedForegroundColor = Console.UnknownColor;
157private static ConsoleColor s_trackedBackgroundColor = Console.UnknownColor;
159public static ConsoleColor ForegroundColor
165public static ConsoleColor BackgroundColor
714public static void MoveBufferArea(int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop, char sourceChar, ConsoleColor sourceForeColor, ConsoleColor sourceBackColor)
749private static void RefreshColors(ref ConsoleColor toChange, ConsoleColor value)
777private static void WriteSetColorString(bool foreground, ConsoleColor color)
System.Windows.Forms.Tests (10)
System.Xaml.Tests (10)
Templates.Blazor.Tests (12)
Templates.Blazor.WebAssembly.Auth.Tests (12)
Templates.Blazor.WebAssembly.Tests (12)
Templates.Mvc.Tests (12)
Templates.Tests (12)
Wasm.Performance.ConsoleHost (12)
xunit.console (29)
Sinks\DiagnosticMessageSink.cs (5)
13readonly ConsoleColor displayColor;
17DiagnosticMessageSink(object consoleLock, string assemblyDisplayName, bool showDiagnostics, bool noColor, ConsoleColor displayColor)
27=> new DiagnosticMessageSink(consoleLock, assemblyDisplayName, showDiagnostics, noColor, ConsoleColor.Yellow);
30=> new DiagnosticMessageSink(consoleLock, null, showDiagnostics, noColor, ConsoleColor.DarkGray);
33=> new DiagnosticMessageSink(consoleLock, assemblyDisplayName, showDiagnostics, noColor, ConsoleColor.DarkGray);