Skip to content

Commit 23cdc6b

Browse files
Add helpers to log a GitHub "notice" (Azure#38574)
Co-authored-by: Mike Harder <[email protected]>
1 parent 7b7a042 commit 23cdc6b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

eng/common/scripts/logging.ps1

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,26 @@ function LogInfo {
1010
Write-Host "$args"
1111
}
1212

13+
function LogNotice {
14+
if (Test-SupportsGitHubLogging) {
15+
Write-Host ("::notice::$args" -replace "`n", "%0D%0A")
16+
}
17+
else {
18+
# No equivalent for DevOps
19+
Write-Host "[Notice] $args"
20+
}
21+
}
22+
23+
function LogNoticeForFile($file, $noticeString) {
24+
if (Test-SupportsGitHubLogging) {
25+
Write-Host ("::notice file=$file,line=1,col=1::$noticeString" -replace "`n", "%0D%0A")
26+
}
27+
else {
28+
# No equivalent for DevOps
29+
Write-Host "[Notice in file $file] $noticeString"
30+
}
31+
}
32+
1333
function LogWarning {
1434
if (Test-SupportsDevOpsLogging) {
1535
Write-Host ("##vso[task.LogIssue type=warning;]$args" -replace "`n", "%0D%0A")

0 commit comments

Comments
 (0)