Last active
September 10, 2015 12:30
-
-
Save hacha/eb685427a3aa7405ff06 to your computer and use it in GitHub Desktop.
リリースビルド時にデバッグログ出力をしないようにするためのラッパー
This file contains 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
#if ! UNITY_EDITOR | |
#define DEBUG_LOG_OVERWRAP | |
#endif | |
using UnityEngine; | |
#if DEBUG_LOG_OVERWRAP | |
public static class Debug | |
{ | |
static public void Break() | |
{ | |
if (IsEnable()) { | |
UnityEngine.Debug.Break(); | |
} | |
} | |
static public void Log(object message) | |
{ | |
if (IsEnable()) { | |
UnityEngine.Debug.Log(message); | |
} | |
} | |
static public void Log(object message, Object context) | |
{ | |
if (IsEnable()) { | |
UnityEngine.Debug.Log(message, context); | |
} | |
} | |
static public void LogWarning(object message) | |
{ | |
if (IsEnable()) { | |
UnityEngine.Debug.LogWarning(message); | |
} | |
} | |
static public void LogWarning(object message, Object context) | |
{ | |
if (IsEnable()) { | |
UnityEngine.Debug.LogWarning(message, context); | |
} | |
} | |
static public void LogError(object message) | |
{ | |
if (IsEnable()) { | |
UnityEngine.Debug.LogError(message); | |
} | |
} | |
static public void LogError(object message, Object context) | |
{ | |
if (IsEnable()) { | |
UnityEngine.Debug.LogError(message, context); | |
} | |
} | |
static public void LogException(System.Exception e) | |
{ | |
if (IsEnable()) { | |
UnityEngine.Debug.LogException(e); | |
} | |
} | |
static public void LogException(System.Exception e, Object context) | |
{ | |
if (IsEnable()) { | |
UnityEngine.Debug.LogException(e, context); | |
} | |
} | |
static bool IsEnable() | |
{ | |
return UnityEngine.Debug.isDebugBuild; | |
} | |
} | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment