feat(logging): prepend fox-mini silhouette to DI-logger bootstrap banner
Pulls the four-line fox-mini ASCII out of the embedded branding
resources and writes each line through IPluginLog before the existing
bootstrap line, so an /xllog reader sees the Hellion Forge mark on
every plugin load. The text provenance ("by Julia Moon - Hellion
Forge") follows the silhouette, then the version + fingerprint line
stays where it was.
Empty lines from the resource are skipped so the log stays compact.
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Reflection;
|
|||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
|
using HellionChat.Branding;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace HellionChat.Infrastructure.Logging;
|
namespace HellionChat.Infrastructure.Logging;
|
||||||
@@ -26,12 +27,22 @@ public sealed class DalamudLoggingProvider : ILoggerProvider
|
|||||||
}
|
}
|
||||||
|
|
||||||
// One-shot per plugin load. Intentionally visible in xllog so uncredited
|
// One-shot per plugin load. Intentionally visible in xllog so uncredited
|
||||||
// ports of the DalamudLogger trio keep announcing their origin.
|
// ports of the DalamudLogger trio keep announcing their origin — the
|
||||||
|
// mini fox silhouette goes first, then the textual provenance line.
|
||||||
private void EmitBootstrapBanner()
|
private void EmitBootstrapBanner()
|
||||||
{
|
{
|
||||||
var version =
|
var version =
|
||||||
typeof(DalamudLoggingProvider).Assembly.GetName().Version?.ToString() ?? "0.0.0";
|
typeof(DalamudLoggingProvider).Assembly.GetName().Version?.ToString() ?? "0.0.0";
|
||||||
var fingerprint = ComputeFingerprint(version);
|
var fingerprint = ComputeFingerprint(version);
|
||||||
|
|
||||||
|
foreach (var line in HellionForgeAscii.FoxMini.Split('\n'))
|
||||||
|
{
|
||||||
|
var trimmed = line.TrimEnd('\r');
|
||||||
|
if (trimmed.Length > 0)
|
||||||
|
_pluginLog.Information(trimmed);
|
||||||
|
}
|
||||||
|
|
||||||
|
_pluginLog.Information("by Julia Moon - Hellion Forge");
|
||||||
_pluginLog.Information(
|
_pluginLog.Information(
|
||||||
$"HellionChat DI-Logger bootstrap v{version} fingerprint={fingerprint}"
|
$"HellionChat DI-Logger bootstrap v{version} fingerprint={fingerprint}"
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user