Skip to content

Commit

Permalink
Add helpers to log a GitHub "notice"
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeharder authored and azure-sdk committed Nov 15, 2024
1 parent 15d3f80 commit fc3f04d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions eng/common/scripts/logging.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,26 @@ function LogInfo {
Write-Host "$args"
}

function LogNotice {
if (Test-SupportsGitHubLogging) {
Write-Host ("::notice::$args" -replace "`n", "%0D%0A")
}
else {
# No equivalent for DevOps
Write-Host "[Notice] $args"
}
}

function LogNoticeForFile($file, $noticeString) {
if (Test-SupportsGitHubLogging) {
Write-Host ("::notice file=$file,line=1,col=1::$noticeString" -replace "`n", "%0D%0A")
}
else {
# No equivalent for DevOps
Write-Host "[Notice in file $file] $noticeString"
}
}

function LogWarning {
if (Test-SupportsDevOpsLogging) {
Write-Host ("##vso[task.LogIssue type=warning;]$args" -replace "`n", "%0D%0A")
Expand Down

0 comments on commit fc3f04d

Please sign in to comment.