Skip to content

Commit cd8e324

Browse files
authored
Merge pull request #261 from rkeithhill/rkeithhill/log-osinfo
Added OS info to log file.
2 parents f395784 + f8ac639 commit cd8e324

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

src/PowerShellEditorServices.Host/EditorServicesHost.cs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,22 @@ public void StartLogging(string logFilePath, LogLevel logLevel)
8686
FileVersionInfo.GetVersionInfo(this.GetType().Assembly.Location);
8787
#endif
8888

89+
string newLine = Environment.NewLine;
90+
8991
Logger.Write(
9092
LogLevel.Normal,
9193
string.Format(
92-
"PowerShell Editor Services Host v{0} starting (pid {1})...\r\n\r\n" +
93-
" Host application details:\r\n\r\n" +
94-
" Name: {2}\r\n ProfileId: {3}\r\n Version: {4}",
95-
fileVersionInfo.FileVersion,
96-
Process.GetCurrentProcess().Id,
97-
this.hostDetails.Name,
98-
this.hostDetails.ProfileId,
99-
this.hostDetails.Version));
94+
$"PowerShell Editor Services Host v{fileVersionInfo.FileVersion} starting (pid {Process.GetCurrentProcess().Id})..." + newLine + newLine +
95+
" Host application details:" + newLine + newLine +
96+
$" Name: {this.hostDetails.Name}" + newLine +
97+
$" ProfileId: {this.hostDetails.ProfileId}" + newLine +
98+
$" Version: {this.hostDetails.Version}" + newLine +
99+
" Arch: {0}" + newLine + newLine +
100+
" Operating system details:" + newLine + newLine +
101+
$" Version: {Environment.OSVersion.VersionString}" + newLine +
102+
" Arch: {1}",
103+
Environment.Is64BitProcess ? "64-bit" : "32-bit",
104+
Environment.Is64BitOperatingSystem ? "64-bit" : "32-bit"));
100105
}
101106

102107
/// <summary>

0 commit comments

Comments
 (0)