// // /*=============================================================================== // // Copyright (C) 2025 PhantomsXR Ltd. All Rights Reserved. // // // // This file is part of the Phantom.XRMOD.QuestModule.Runtime. // // // // The XR-MOD cannot be copied, distributed, or made available to // // third-parties for commercial purposes without written permission of PhantomsXR Ltd. // // // // Contact nswell@phantomsxr.com for licensing requests. // // ===============================================================================*/ using UnityEngine; namespace Phantom.XRMOD.QuestModule.Runtime { /// /// Utility class for handling debug logging with varied levels of verbosity. /// public static class PassthroughCameraDebugger { /// /// Defines available debug levels. /// public enum DebuglevelEnum { /// /// Log everything (Info, Warning, Error). /// ALL, /// /// Log nothing. /// NONE, /// /// Log only errors. /// ONLY_ERROR, /// /// Log only standard messages. /// ONLY_LOG, /// /// Log only warnings. /// ONLY_WARNING } /// /// Current debug level setting. Defaults to . /// public static DebuglevelEnum DebugLevel = DebuglevelEnum.ALL; /// /// Send debug information to Unity console based on DebugType and DebugLevel. /// /// The type of log message (Error, Log, Warning). /// The message string to log. public static void DebugMessage(LogType mType, string message) { switch (mType) { case LogType.Error: if (DebugLevel is DebuglevelEnum.ALL or DebuglevelEnum.ONLY_ERROR) { Debug.LogError(message); } break; case LogType.Log: if (DebugLevel is DebuglevelEnum.ALL or DebuglevelEnum.ONLY_LOG) { Debug.Log(message); } break; case LogType.Warning: if (DebugLevel is DebuglevelEnum.ALL or DebuglevelEnum.ONLY_WARNING) { Debug.LogWarning(message); } break; } } } }