Skip to content

Commit 712885f

Browse files
authored
Sync eng/common directory with azure-sdk-tools repository for Tools PR 974 (#13650)
1 parent 33b03e6 commit 712885f

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

eng/common/scripts/common.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ $EngScriptsDir = Join-Path $EngDir "scripts"
88
. (Join-Path $EngCommonScriptsDir SemVer.ps1)
99
. (Join-Path $EngCommonScriptsDir ChangeLog-Operations.ps1)
1010
. (Join-Path $EngCommonScriptsDir Package-Properties.ps1)
11+
. (Join-Path $EngCommonScriptsDir logging.ps1)
1112

1213
# Setting expected from common languages settings
1314
$Language = "Unknown"
@@ -20,7 +21,7 @@ $EngScriptsLanguageSettings = Join-path $EngScriptsDir "Language-Settings.ps1"
2021
if (Test-Path $EngScriptsLanguageSettings) {
2122
. $EngScriptsLanguageSettings
2223
}
23-
If ($LanguageShort -eq $null)
24+
if (-not $LanguageShort)
2425
{
2526
$LangaugeShort = $Language
2627
}

eng/common/scripts/logging.ps1

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
if (-not $isDevOpsRun)
2+
{
3+
$isDevOpsRun = ($null -ne $env:SYSTEM_TEAMPROJECTID)
4+
}
5+
6+
function LogWarning
7+
{
8+
if ($isDevOpsRun)
9+
{
10+
Write-Host "##vso[task.LogIssue type=warning;]$args"
11+
}
12+
else
13+
{
14+
Write-Warning "$args"
15+
}
16+
}
17+
18+
function LogError
19+
{
20+
if ($isDevOpsRun)
21+
{
22+
Write-Host "##vso[task.LogIssue type=error;]$args"
23+
}
24+
else
25+
{
26+
Write-Error "$args"
27+
}
28+
}
29+
30+
function LogDebug
31+
{
32+
if ($isDevOpsRun)
33+
{
34+
Write-Host "##vso[task.LogIssue type=debug;]$args"
35+
}
36+
else
37+
{
38+
Write-Debug "$args"
39+
}
40+
}

0 commit comments

Comments
 (0)