1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- namespace Rokid.UXR
- {
- /// <summary>
- /// Log Utility
- /// </summary>
- public class RKLog
- {
- public enum LogLevel
- {
- Debug,
- Info,
- Warning,
- Error
- }
- private static LogLevel logLevel = LogLevel.Info;
- private static bool logEnable = true;
- public static void SetLogEnable(bool logEnable)
- {
- RKLog.logEnable = logEnable;
- }
- public static void SetLogLevel(LogLevel logLevel)
- {
- RKLog.logLevel = logLevel;
- }
- public static void Info(string msg)
- {
- if (logLevel <= LogLevel.Info && logEnable)
- {
- UnityEngine.Debug.Log($"[RKLogInfo]:{msg}");
- }
- }
- public static void Debug(string msg)
- {
- if (logLevel <= LogLevel.Debug && logEnable)
- {
- UnityEngine.Debug.Log($"[RKLogDebug]:{msg}");
- }
- }
- public static void Warning(string msg)
- {
- if (logLevel <= LogLevel.Warning && logEnable)
- {
- UnityEngine.Debug.LogWarning($"[RKLogWarning]:{msg}");
- }
- }
- public static void Error(string msg)
- {
- if (logEnable)
- UnityEngine.Debug.LogError($"[RKLogError]:{msg}");
- }
- public static void KeyInfo(string msg)
- {
- UnityEngine.Debug.Log($"[RKKeyInfo]:{msg}");
- }
- }
- }
|