namespace Godosa.Core.Diagnostics; /// The lib's own debug categories (input, script, audio), read /// from the game's variable: call first in Main, before any lib /// code runs. Gate each call on its flag so disabled logging costs one bool check and no /// string formatting. public static class EngineDebug { public static bool Input { get; private set; } public static bool Script { get; private set; } public static bool Audio { get; private set; } public static void Configure(string environmentVariable) => Apply(new DebugFlags(Environment.GetEnvironmentVariable(environmentVariable))); public static void Apply(DebugFlags flags) { Input = flags.On("input"); Script = flags.On("script"); Audio = flags.On("audio"); } public static void Write(string category, string message) => Console.Error.WriteLine($"[{category}] {message}"); }