Skip to content

Commit d0899f7

Browse files
Stop Diagnostic logging from logging to stdio when the communication protocol is set to stdio (#709)
1 parent 87376c3 commit d0899f7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

module/PowerShellEditorServices/Start-EditorServices.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,12 @@ param(
7878
$DEFAULT_USER_MODE = "600"
7979

8080
if ($LogLevel -eq "Diagnostic") {
81-
$VerbosePreference = 'Continue'
81+
if (!$Stdio.IsPresent) {
82+
$VerbosePreference = 'Continue'
83+
}
8284
$scriptName = [System.IO.Path]::GetFileNameWithoutExtension($MyInvocation.MyCommand.Name)
8385
$logFileName = [System.IO.Path]::GetFileName($LogPath)
84-
Start-Transcript (Join-Path (Split-Path $LogPath -Parent) "$scriptName-$logFileName") -Force
86+
Start-Transcript (Join-Path (Split-Path $LogPath -Parent) "$scriptName-$logFileName") -Force | Out-Null
8587
}
8688

8789
function LogSection([string]$msg) {

0 commit comments

Comments
 (0)