From 19f1aa4879b63ed70019ec8040a40909cb299451 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 1 Apr 2025 14:40:07 -0700 Subject: [PATCH] Update logging functions for github actions (#6499) We need to use Write-Host for the custom logging commands to get them correctly out into stdout which is what they need to be interpreted correctly. Co-authored-by: Wes Haggard --- eng/common/scripts/logging.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/common/scripts/logging.ps1 b/eng/common/scripts/logging.ps1 index 1b459d004..94dc900db 100644 --- a/eng/common/scripts/logging.ps1 +++ b/eng/common/scripts/logging.ps1 @@ -35,7 +35,7 @@ function LogWarning { Write-Host ("##vso[task.LogIssue type=warning;]$args" -replace "`n", "%0D%0A") } elseif (Test-SupportsGitHubLogging) { - Write-Warning ("::warning::$args" -replace "`n", "%0D%0A") + Write-Host ("::warning::$args" -replace "`n", "%0D%0A") } else { Write-Warning "$args" @@ -56,7 +56,7 @@ function LogErrorForFile($file, $errorString) Write-Host ("##vso[task.logissue type=error;sourcepath=$file;linenumber=1;columnnumber=1;]$errorString" -replace "`n", "%0D%0A") } elseif (Test-SupportsGitHubLogging) { - Write-Error ("::error file=$file,line=1,col=1::$errorString" -replace "`n", "%0D%0A") + Write-Host ("::error file=$file,line=1,col=1::$errorString" -replace "`n", "%0D%0A") } else { Write-Error "[Error in file $file]$errorString" @@ -68,7 +68,7 @@ function LogError { Write-Host ("##vso[task.LogIssue type=error;]$args" -replace "`n", "%0D%0A") } elseif (Test-SupportsGitHubLogging) { - Write-Error ("::error::$args" -replace "`n", "%0D%0A") + Write-Host ("::error::$args" -replace "`n", "%0D%0A") } else { Write-Error "$args" @@ -80,7 +80,7 @@ function LogDebug { Write-Host "[debug]$args" } elseif (Test-SupportsGitHubLogging) { - Write-Debug "::debug::$args" + Write-Host "::debug::$args" } else { Write-Debug "$args"