Created
October 12, 2017 08:38
-
-
Save ryo-ma/468182963bc24e7b20e1d6bfc9dd53a0 to your computer and use it in GitHub Desktop.
Unity Disable debug log by Debug class override.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| public static class Debug | |
| { | |
| static Debug() | |
| { | |
| Disable(); | |
| } | |
| public static void Disable() | |
| { | |
| UnityEngine.Debug.logger.logEnabled = false; | |
| } | |
| public static void Log(object message) | |
| { | |
| UnityEngine.Debug.Log(message); | |
| } | |
| public static void Log(object message, UnityEngine.Object context) | |
| { | |
| UnityEngine.Debug.Log(message, context); | |
| } | |
| public static void LogError(object message) | |
| { | |
| UnityEngine.Debug.LogError(message); | |
| } | |
| public static void DrawLine(Vector3 start, Vector3 end) | |
| { | |
| UnityEngine.Debug.DrawLine(start, end); | |
| } | |
| public static void DrawLine(Vector3 start, Vector3 end, Color color) | |
| { | |
| UnityEngine.Debug.DrawLine(start, end, color); | |
| } | |
| public static void DrawRay(Vector3 start, Vector3 dir, Color color, float duration = 0.0f, bool depthTest = true) | |
| { | |
| UnityEngine.Debug.DrawRay(start, dir, color, duration); | |
| } | |
| public static void LogWarning(object message) | |
| { | |
| UnityEngine.Debug.LogWarning(message); | |
| } | |
| public static void LogWarning(object message, UnityEngine.Object context) | |
| { | |
| UnityEngine.Debug.LogWarning(message, context); | |
| } | |
| public static void LogFormat(string format, params object[] args) | |
| { | |
| UnityEngine.Debug.LogFormat(format, args); | |
| } | |
| public static void LogException(Exception exception) | |
| { | |
| UnityEngine.Debug.LogException(exception); | |
| } | |
| public static void LogException(Exception exception, UnityEngine.Object context) | |
| { | |
| UnityEngine.Debug.LogException(exception, context); | |
| } | |
| public static bool isDebugBuild = UnityEngine.Debug.isDebugBuild; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment