Skip to content

Commit 94c0207

Browse files
committed
Replace Write-Information with Write-Debug for logging
Updated various scripts to use Write-Debug instead of Write-Information for internal logging and status messages. This change helps reduce noise in standard output and aligns logging with debug-level verbosity.
1 parent e01b728 commit 94c0207

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/New-CippCoreRequest.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ function New-CippCoreRequest {
159159
$HttpTimings['Total'] = $HttpTotalStopwatch.Elapsed.TotalMilliseconds
160160
$HttpTimingsRounded = [ordered]@{}
161161
foreach ($Key in ($HttpTimings.Keys | Sort-Object)) { $HttpTimingsRounded[$Key] = [math]::Round($HttpTimings[$Key], 2) }
162-
Write-Information "#### HTTP Request Timings #### $($HttpTimingsRounded | ConvertTo-Json -Compress)"
162+
Write-Debug "#### HTTP Request Timings #### $($HttpTimingsRounded | ConvertTo-Json -Compress)"
163163
return ([HttpResponseContext]@{
164164
StatusCode = $Response.StatusCode
165165
Body = $Response.Body

Modules/CippEntrypoints/CippEntrypoints.psm1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function Receive-CippHttpTrigger {
2121
if ($Request.Headers.'x-ms-coldstart' -eq 1) {
2222
Write-Information '** Function app cold start detected **'
2323
}
24-
Write-Information "CIPP_ACTION=$($Request.Params.CIPPEndpoint)"
24+
Write-Debug "CIPP_ACTION=$($Request.Params.CIPPEndpoint)"
2525

2626
$ConfigTable = Get-CIPPTable -tablename Config
2727
$Config = Get-CIPPAzDataTableEntity @ConfigTable -Filter "PartitionKey eq 'OffloadFunctions' and RowKey eq 'OffloadFunctions'"
@@ -172,7 +172,7 @@ function Receive-CippOrchestrationTrigger {
172172
Entrypoint
173173
#>
174174
param($Context)
175-
Write-Information "CIPP_ACTION=$($Item.Command ?? $Item.FunctionName)"
175+
Write-Debug "CIPP_ACTION=$($Item.Command ?? $Item.FunctionName)"
176176
try {
177177
if (Test-Json -Json $Context.Input) {
178178
$OrchestratorInput = $Context.Input | ConvertFrom-Json
@@ -287,7 +287,7 @@ function Receive-CippActivityTrigger {
287287
Entrypoint
288288
#>
289289
param($Item)
290-
Write-Information "CIPP_ACTION=$($Item.Command ?? $Item.FunctionName)"
290+
Write-Debug "CIPP_ACTION=$($Item.Command ?? $Item.FunctionName)"
291291
Write-Warning "Hey Boo, the activity function is running. Here's some info: $($Item | ConvertTo-Json -Depth 10 -Compress)"
292292
try {
293293
$Output = $null
@@ -360,7 +360,7 @@ function Receive-CippActivityTrigger {
360360
}
361361

362362
try {
363-
Write-Verbose "Activity starting Function: $FunctionName."
363+
Write-Verbose "Activity starting Function: $FunctionName."
364364
Invoke-Command -ScriptBlock { & $FunctionName -Item $Item }
365365
$Status = 'Completed'
366366

@@ -477,9 +477,9 @@ function Receive-CIPPTimerTrigger {
477477
}
478478

479479
# Wrap the timer function execution with telemetry
480-
480+
481481
Invoke-Command -ScriptBlock { & $Function.Command @Parameters }
482-
482+
483483

484484
if ($Results -match '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$') {
485485
$FunctionStatus.OrchestratorId = $Results -join ','

profile.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if ($hasAppInsights) {
1313
try {
1414
$AppInsightsDllPath = Join-Path $PSScriptRoot 'Shared\AppInsights\Microsoft.ApplicationInsights.dll'
1515
$null = [Reflection.Assembly]::LoadFile($AppInsightsDllPath)
16-
Write-Information 'Application Insights SDK loaded successfully'
16+
Write-Debug 'Application Insights SDK loaded successfully'
1717
} catch {
1818
Write-Warning "Failed to load Application Insights SDK: $($_.Exception.Message)"
1919
}
@@ -52,13 +52,13 @@ if ($hasAppInsights -and -not $global:TelemetryClient) {
5252
$config.ConnectionString = $connectionString
5353
$global:TelemetryClient = [Microsoft.ApplicationInsights.TelemetryClient]::new($config)
5454
Enable-CippConsoleLogging
55-
Write-Information 'TelemetryClient initialized with connection string'
55+
Write-Debug 'TelemetryClient initialized with connection string'
5656
} elseif ($env:APPINSIGHTS_INSTRUMENTATIONKEY) {
5757
# Fall back to instrumentation key
5858
$global:TelemetryClient = [Microsoft.ApplicationInsights.TelemetryClient]::new()
5959
$global:TelemetryClient.InstrumentationKey = $env:APPINSIGHTS_INSTRUMENTATIONKEY
6060
Enable-CippConsoleLogging
61-
Write-Information 'TelemetryClient initialized with instrumentation key'
61+
Write-Debug 'TelemetryClient initialized with instrumentation key'
6262
}
6363
} catch {
6464
Write-Warning "Failed to initialize TelemetryClient: $($_.Exception.Message)"
@@ -71,7 +71,7 @@ $SwDurableSDK = [System.Diagnostics.Stopwatch]::StartNew()
7171
if ($env:ExternalDurablePowerShellSDK -eq $true) {
7272
try {
7373
Import-Module AzureFunctions.PowerShell.Durable.SDK -ErrorAction Stop
74-
Write-Information 'External Durable SDK enabled'
74+
Write-Debug 'External Durable SDK enabled'
7575
} catch {
7676
Write-LogMessage -message 'Failed to import module - AzureFunctions.PowerShell.Durable.SDK' -LogData (Get-CippException -Exception $_) -Sev 'debug'
7777
$_.Exception.Message
@@ -83,7 +83,7 @@ $Timings['DurableSDK'] = $SwDurableSDK.Elapsed.TotalMilliseconds
8383
$SwAuth = [System.Diagnostics.Stopwatch]::StartNew()
8484
try {
8585
if (!$env:SetFromProfile) {
86-
Write-Information "We're reloading from KV"
86+
Write-Debug "We're reloading from KV"
8787
$Auth = Get-CIPPAuthentication
8888
}
8989
} catch {
@@ -121,7 +121,7 @@ if (!$LastStartup -or $CurrentVersion -ne $LastStartup.Version) {
121121

122122
$ReleaseTable = Get-CippTable -tablename 'cacheGitHubReleaseNotes'
123123
Remove-AzDataTableEntity @ReleaseTable -Entity @{ PartitionKey = 'GitHubReleaseNotes'; RowKey = 'GitHubReleaseNotes' } -ErrorAction SilentlyContinue
124-
Write-Host 'Cleared GitHub release notes cache to force refresh on version update.'
124+
Write-Debug 'Cleared GitHub release notes cache to force refresh on version update.'
125125
}
126126
$SwVersion.Stop()
127127
$Timings['VersionCheck'] = $SwVersion.Elapsed.TotalMilliseconds

0 commit comments

Comments
 (0)