Skip to content

Commit f9eb3e3

Browse files
committed
Added OS info to log file.
It is handy to know which version of the OS we are running on and what architecture for both the extension hosts and the OS. Also, converted from \r\n to Environment.NewLine just in case this code runs on Linux/MacOSX someday. :-)
1 parent f395784 commit f9eb3e3

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+
var 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)