Skip to content

Commit

Permalink
#3794 Enabled log prefixes, hidded debug/info logging by default
Browse files Browse the repository at this point in the history
Color-coded logging does not work because of issue in Cake cake-build/cake#1633
  • Loading branch information
Alexander Doroshenko authored and jeanfrancoislarente committed Nov 27, 2019
1 parent 9551201 commit 838cbe3
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions scripts/Unicorn/Unicorn.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -97,22 +97,26 @@ Function Invoke-StreamingWebRequest($Uri, $MAC, $Nonce) {
$responseStreamReader = new-object System.IO.StreamReader $responseStream

while(-not $responseStreamReader.EndOfStream) {
$line = $responseStreamReader.ReadLine()
$line = $responseStreamReader.ReadLine().Trim()
if([string]::IsNullOrEmpty($line))
{
continue
}

if($line.StartsWith('Error:')) {
Write-Host $line.Substring(7) -ForegroundColor Red
Write-Host $line -ForegroundColor Red
}
elseif($line.StartsWith('Warning:')) {
Write-Host $line.Substring(9) -ForegroundColor Yellow
}
elseif($line.StartsWith('Debug:')) {
Write-Host $line.Substring(7) -ForegroundColor Gray
Write-Host $line -ForegroundColor Yellow
}
elseif($line.StartsWith('Info:')) {
Write-Host $line.Substring(6) -ForegroundColor White
Write-Verbose $line -Verbose
}
elseif($line.StartsWith('Debug:')) {
Write-Verbose $line -Verbose
}
else {
Write-Host $line -ForegroundColor White
Write-Host $line
}

[void]$responseText.AppendLine($line)
Expand Down

0 comments on commit 838cbe3

Please sign in to comment.