Skip to content

Commit a551a5b

Browse files
committed
Source location in CM log
1 parent 127f710 commit a551a5b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/Winget-AutoUpdate/functions/Write-ToLog.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ function Write-ToLog {
9999
}
100100

101101
# Create the log entry in CM format - note the exact format needed for OneTrace
102-
$CMLogLine = "<![LOG[$LogMsg]LOG]!><time=`"$time`" date=`"$date`" component=`"$Component`" context=`"`" type=`"$CMLogLevel`" thread=`"$ThreadID`" file=`"`">"
102+
$ComputerName = $env:COMPUTERNAME
103+
$CMLogLine = "<![LOG[$LogMsg]LOG]!><time=`"$time`" date=`"$date`" component=`"$Component`" context=`"`" type=`"$CMLogLevel`" thread=`"$ThreadID`" file=`"$ComputerName`">"
103104

104105
# Write to CM log file
105106
$CMLogLine | Out-File -FilePath $CMLogFile -Append

0 commit comments

Comments
 (0)