Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[logging.ps1] Add helpers to log a GitHub "notice" #9389

Merged
merged 1 commit into from
Nov 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading