0
0
mirror of https://github.com/sp-tarkov/patcher.git synced 2025-02-12 16:50:45 -05:00

add os info to logs

This commit is contained in:
IsWaffle 2022-06-16 09:13:14 -04:00
parent 400372a21f
commit c959a8900c
5 changed files with 27 additions and 6 deletions

View File

@ -4,8 +4,8 @@
<TargetFramework>net6.0</TargetFramework>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<Nullable>enable</Nullable>
<AssemblyVersion>2.9.1</AssemblyVersion>
<FileVersion>2.9.1</FileVersion>
<AssemblyVersion>2.9.2</AssemblyVersion>
<FileVersion>2.9.2</FileVersion>
</PropertyGroup>
<ItemGroup>
<AvaloniaResource Include="Assets\**" />

View File

@ -4,8 +4,8 @@
<TargetFramework>net6.0</TargetFramework>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<Nullable>enable</Nullable>
<AssemblyVersion>2.9.1</AssemblyVersion>
<FileVersion>2.9.1</FileVersion>
<AssemblyVersion>2.9.2</AssemblyVersion>
<FileVersion>2.9.2</FileVersion>
</PropertyGroup>
<ItemGroup>

Binary file not shown.

View File

@ -1,5 +1,6 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace PatcherUtils.Model
{
@ -23,6 +24,24 @@ namespace PatcherUtils.Model
return DateTime.Now.ToString("MM/dd/yyyy - hh:mm:ss tt]");
}
public static void LogOSInfo()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
LogToFile($"{GetTimestamp()}[OS]: Windows");
if(RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
LogToFile($"{GetTimestamp()}[OS]: Linux");
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
LogToFile($"{GetTimestamp()}[OS]: OSX");
if (RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD))
LogToFile($"{GetTimestamp()}[OS]: FreeBSD");
LogToFile($"{GetTimestamp()}[OS]: {RuntimeInformation.OSDescription}");
}
public static void LogInfo(string message) => LogToFile($"{GetTimestamp()}[INFO]: {message}");
public static void LogError(string message) => LogToFile($"{GetTimestamp()}[ERROR]: {message}");
public static void LogException(Exception ex) => LogToFile($"{GetTimestamp()}[EXCEPTION]: {ex.Message}\n\nStackTrace:\n{ex.StackTrace}");

View File

@ -374,6 +374,8 @@ namespace PatcherUtils
{
PatchLogger.LogInfo("::: Starting patch application :::");
PatchLogger.LogOSInfo();
//get needed directory information
DirectoryInfo sourceDir = new DirectoryInfo(SourceFolder);
DirectoryInfo deltaDir = new DirectoryInfo(DeltaFolder);