Skip to content

Commit

Permalink
Small changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
CptMoore committed Dec 10, 2024
1 parent 6236e08 commit d5f64b7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
8 changes: 4 additions & 4 deletions ModTek/Features/Logging/AppenderFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ internal AppenderFile(string path, AppenderSettings settings)
_writer = new LogStream(path);

MTLoggerMessageDto.GetTimings(out var stopwatchTimestamp, out var dateTime, out var unityStartupTime);
Write(System.Text.Encoding.UTF8.GetBytes(
Write(
$"""
ModTek v{GitVersionInformation.InformationalVersion} ({GitVersionInformation.CommitDate})
{Environment.OSVersion} ; BattleTech {Application.version} ; Unity {Application.unityVersion} ; CLR {Environment.Version} ; {System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription}"
{dateTime.ToLocalTime().ToString("o", CultureInfo.InvariantCulture)} {nameof(unityStartupTime)}={unityStartupTime.ToString(null, CultureInfo.InvariantCulture)} {nameof(stopwatchTimestamp)}={stopwatchTimestamp}
{new string('-', 80)}
{VersionInfo.GetFormattedInfo()}
"""
));
);
}

private void Write(byte[] bytes)
private void Write(string text)
{
var bytes = System.Text.Encoding.UTF8.GetBytes(text);
Write(bytes, bytes.Length);
}

Expand Down
4 changes: 2 additions & 2 deletions ModTek/Features/Logging/FastBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ internal void Append(string value)

internal void AppendLast2Digits(long value)
{
Append((char)(value / 10 + '0'));
Append((char)(value % 10 + '0'));
Append((char)(((value / 10) % 10) + '0'));
Append((char)(((value / 1) % 10) + '0'));
}

internal void AppendLast7Digits(long value)
Expand Down
8 changes: 8 additions & 0 deletions ModTek/ModTek.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@
<Asset Include="$(ProjectDir)\..\LICENSE" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

<!-- helpful direct access to resources in BT, might trigger IDE indexing -->
<!--
<ItemGroup>
<None Include="$(BattleTechGameDir)\Mods\.modtek\*.txt;$(BattleTechGameDir)\Mods\.modtek\*.log" LinkBase=".modtek" />
<None Include="$(BattleTechGameDir)\BattleTech_Data\StreamingAssets\data\**\*.json;$(BattleTechGameDir)\BattleTech_Data\StreamingAssets\data\**\*.csv" LinkBase="BattleTech_Data"/>
</ItemGroup>
-->

<ItemGroup>
<ProjectReference Include="..\ModTek.Common\ModTek.Common.csproj" />
</ItemGroup>
Expand Down

0 comments on commit d5f64b7

Please sign in to comment.