Created
June 4, 2018 17:02
-
-
Save SachinGanesh/6cec483ebedc488b9235ec7e445ff765 to your computer and use it in GitHub Desktop.
Unity3d Custom Logger. Display called Class in the console
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
public class Log { | |
static bool ShowLogs = true; | |
Log(){ | |
#if Debug | |
ShowLogs = true; | |
#else | |
ShowLogs = false; | |
#endif | |
} | |
public static void d (string message) { | |
Debug.Log (message); | |
} | |
public static void i (Object o, string message) { | |
if (ShowLogs) | |
Debug.Log ("<color=green>" + o + "</color> : " + message); | |
} | |
public static void i (string message) { | |
if (ShowLogs) | |
Debug.Log ("<color=green> Info </color> : " + message); | |
} | |
public static void e (Object o, string message) { | |
if (ShowLogs) | |
Debug.Log ("<color=red>" + o + "</color> : " + message); | |
} | |
public static void e (string message) { | |
if (ShowLogs) | |
Debug.Log ("<color=red> Error </color> : " + message); | |
} | |
public static void w (Object o, string message) { | |
if (ShowLogs) | |
Debug.Log ("<color=blue>" + o + "</color> : " + message); | |
} | |
public static void w (string message) { | |
if (ShowLogs) | |
Debug.Log ("<color=blue> Warning </color> : " + message); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment