mirror of
https://github.com/Jacobwasbeast/LegacyWeaveLoader.git
synced 2026-05-22 05:34:36 +00:00
- Replace dbghelp with raw_pdb library for cross-platform PDB symbol resolution - Add main menu branding overlay via C4JRender::Present hook - Add creative inventory item injection from mods - Add file-based logging (LogUtil) alongside console output - Fix mod discovery with custom AssemblyLoadContext for proper type identity - Add file dialog for game path selection in launcher - Add CreativeTab enum and block/item creative tab assignment - Unify build output to single ModLoader/build directory
37 lines
1.1 KiB
C#
37 lines
1.1 KiB
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
|
|
{
|
|
private static Action<string, LogLevel>? LogHandler;
|
|
|
|
/// <summary>
|
|
/// Set the log handler that routes messages to the native runtime.
|
|
/// Called by LegacyForge.Core during initialization.
|
|
/// </summary>
|
|
public static void SetLogHandler(Action<string, LogLevel> handler) => LogHandler = handler;
|
|
|
|
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}");
|
|
}
|
|
}
|