From 13cee9a4311388d7bace521fcfe34c7ce94c552c Mon Sep 17 00:00:00 2001 From: ppc Date: Wed, 15 Jan 2025 11:13:52 +0000 Subject: [PATCH] update logging output --- AMNet.Server/Config.cs | 3 +++ AMNet.Server/DllMain.cs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/AMNet.Server/Config.cs b/AMNet.Server/Config.cs index 482c9bf..0018478 100644 --- a/AMNet.Server/Config.cs +++ b/AMNet.Server/Config.cs @@ -1,4 +1,5 @@ using System; +using System.Reflection; using Windows.Win32; using Windows.Win32.Foundation; @@ -41,6 +42,8 @@ internal static class Config /// public static string AimeTxtPath { get; } + public static Version ServerVersion { get; } = new(Assembly.GetExecutingAssembly().GetCustomAttribute()?.Version ?? "1.0"); + internal static unsafe string ReadKey(string section, string key, uint maxLength, string @default = null) { // +1 for null terminator diff --git a/AMNet.Server/DllMain.cs b/AMNet.Server/DllMain.cs index cda2438..248ded4 100644 --- a/AMNet.Server/DllMain.cs +++ b/AMNet.Server/DllMain.cs @@ -36,7 +36,7 @@ public static class DllMain CancellationTokenRegistration? cancellationRegistration = null; cancellationRegistration = App.Lifetime.ApplicationStarted.Register(() => { - App.Logger.LogInformation("AMNet Server ({gameId}) started successfully.", Config.GameId ?? "SXXX"); + App.Logger.LogInformation("AMNet Server v{version} ({gameId}) started.", Config.ServerVersion.ToString(Config.ServerVersion.Build > 0 ? 3 : 2), Config.GameId ?? "SXXX"); App.Logger.LogInformation("Visit {addr} from a mobile device on the same network to get started.", WebAddress); // ReSharper disable once AccessToModifiedClosure @@ -125,7 +125,7 @@ public static class DllMain } Marshal.Copy(card.IDm, 0, idm, sizeof(ulong)); - App.Logger.LogInformation("FeliCa IDm read: {idm}", card.IDm); + App.Logger.LogInformation("FeliCa IDm read: {idm}", CardPresenter.FormatHexCode(card.IDm)); return 0; }