mirror of
https://github.com/Jacobwasbeast/LegacyWeaveLoader.git
synced 2026-05-22 05:34:36 +00:00
SKSE-style external mod loader with zero game source modifications. - LegacyForge.Launcher: C# console app that injects runtime DLL into game process - LegacyForgeRuntime: C++ DLL with PDB symbol resolution, MinHook function hooking, and .NET CoreCLR hosting - LegacyForge.Core: C# mod discovery and lifecycle management - LegacyForge.API: Fabric-style mod API with namespaced string IDs, fluent property builders, and event system - ExampleMod: Sample mod demonstrating block/item registration
31 lines
882 B
C#
31 lines
882 B
C#
namespace LegacyForge.API;
|
|
|
|
public enum LogLevel
|
|
{
|
|
Debug = 0,
|
|
Info = 1,
|
|
Warning = 2,
|
|
Error = 3
|
|
}
|
|
|
|
/// <summary>
|
|
/// Logging facade that routes messages through the native runtime to the game's debug output.
|
|
/// </summary>
|
|
public static class Logger
|
|
{
|
|
internal static Action<string, LogLevel>? LogHandler;
|
|
|
|
public static void Debug(string message) => Log(message, LogLevel.Debug);
|
|
public static void Info(string message) => Log(message, LogLevel.Info);
|
|
public static void Warning(string message) => Log(message, LogLevel.Warning);
|
|
public static void Error(string message) => Log(message, LogLevel.Error);
|
|
|
|
public static void Log(string message, LogLevel level = LogLevel.Info)
|
|
{
|
|
if (LogHandler != null)
|
|
LogHandler(message, level);
|
|
else
|
|
Console.WriteLine($"[LegacyForge/{level}] {message}");
|
|
}
|
|
}
|