Skip to content

Commit c6c6c35

Browse files
committed
fix: log message console color
1 parent 2c5d145 commit c6c6c35

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Docfx.Common/Loggers/ConsoleLogListener.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ public void WriteLine(ILogItem item)
5555

5656
message.Append(item.Message);
5757

58-
AnsiConsole.Foreground = consoleColor;
59-
AnsiConsole.Console.Write(new NonBreakingText($"{message}\n"));
58+
AnsiConsole.Console.Write(new NonBreakingText($"{message}\n", new(consoleColor)));
6059
}
6160

6261
public void Dispose()
@@ -67,9 +66,9 @@ public void Flush()
6766
{
6867
}
6968

70-
class NonBreakingText(string text) : IRenderable
69+
class NonBreakingText(string text, Style style) : IRenderable
7170
{
72-
private readonly Paragraph _paragraph = new(text);
71+
private readonly Paragraph _paragraph = new(text, style);
7372

7473
public Measurement Measure(RenderOptions options, int maxWidth) => ((IRenderable)_paragraph).Measure(options, int.MaxValue);
7574
public IEnumerable<Segment> Render(RenderOptions options, int maxWidth) => ((IRenderable)_paragraph).Render(options, int.MaxValue);

0 commit comments

Comments
 (0)