Skip to content

Commit c3119f9

Browse files
Update logging functions for github actions (#40314)
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 <weshaggard@users.noreply.github.com>
1 parent 21d868d commit c3119f9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

eng/common/scripts/logging.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function LogWarning {
3535
Write-Host ("##vso[task.LogIssue type=warning;]$args" -replace "`n", "%0D%0A")
3636
}
3737
elseif (Test-SupportsGitHubLogging) {
38-
Write-Warning ("::warning::$args" -replace "`n", "%0D%0A")
38+
Write-Host ("::warning::$args" -replace "`n", "%0D%0A")
3939
}
4040
else {
4141
Write-Warning "$args"
@@ -56,7 +56,7 @@ function LogErrorForFile($file, $errorString)
5656
Write-Host ("##vso[task.logissue type=error;sourcepath=$file;linenumber=1;columnnumber=1;]$errorString" -replace "`n", "%0D%0A")
5757
}
5858
elseif (Test-SupportsGitHubLogging) {
59-
Write-Error ("::error file=$file,line=1,col=1::$errorString" -replace "`n", "%0D%0A")
59+
Write-Host ("::error file=$file,line=1,col=1::$errorString" -replace "`n", "%0D%0A")
6060
}
6161
else {
6262
Write-Error "[Error in file $file]$errorString"
@@ -68,7 +68,7 @@ function LogError {
6868
Write-Host ("##vso[task.LogIssue type=error;]$args" -replace "`n", "%0D%0A")
6969
}
7070
elseif (Test-SupportsGitHubLogging) {
71-
Write-Error ("::error::$args" -replace "`n", "%0D%0A")
71+
Write-Host ("::error::$args" -replace "`n", "%0D%0A")
7272
}
7373
else {
7474
Write-Error "$args"
@@ -80,7 +80,7 @@ function LogDebug {
8080
Write-Host "[debug]$args"
8181
}
8282
elseif (Test-SupportsGitHubLogging) {
83-
Write-Debug "::debug::$args"
83+
Write-Host "::debug::$args"
8484
}
8585
else {
8686
Write-Debug "$args"

0 commit comments

Comments
 (0)