Skip to content

Commit

Permalink
(GH-674)(GH-672) Color Overrides / Fix Write-Host
Browse files Browse the repository at this point in the history
Write-Host was double printing, but it appears that it was due to
calling Write, and then an empty WriteLine, both of which the
PoshHostUserInterface were calling a log entry which writes out each as
a line. Instead log just to the file and print with `Console.Write` and
`Console.WriteLine`.  Using `Console` calls solves the issue of not
seeing the colorization overrides, so those will be displayed properly.
  • Loading branch information
ferventcoder committed Mar 29, 2016
1 parent 499c948 commit 3ff48ef
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public override void Write(ConsoleColor foregroundColor, ConsoleColor background
System.Console.ForegroundColor = foregroundColor;
System.Console.BackgroundColor = backgroundColor;

//todo: this should console out and then log to the file without showing it
this.Log().Info(value.escape_curly_braces());
Console.Write(value);
this.Log().Info(ChocolateyLoggers.LogFileOnly, value.escape_curly_braces());

System.Console.ForegroundColor = originalForegroundColor;
System.Console.BackgroundColor = originalBackgroundColor;
Expand All @@ -94,8 +94,8 @@ public override void WriteLine(ConsoleColor foregroundColor, ConsoleColor backgr
System.Console.ForegroundColor = foregroundColor;
System.Console.BackgroundColor = backgroundColor;

//todo: this should console out and then log to the file without showing it
this.Log().Info(value.escape_curly_braces());
Console.WriteLine(value);
this.Log().Info(ChocolateyLoggers.LogFileOnly, value.escape_curly_braces());

System.Console.ForegroundColor = originalForegroundColor;
System.Console.BackgroundColor = originalBackgroundColor;
Expand Down

0 comments on commit 3ff48ef

Please sign in to comment.