using UnityEngine;
using UnityEngine.Assertions;
using System.Collections;
using System;
public static class LOG
{
private static string WARN_MESSAGE = "Warning : ";
private static string ERROR_MESSAGE = "Error : ";
private static string EXCEPTION_MESSAGE = "Exception : ";
private static string INFO_MESSAGE = "Info : ";
//Each enumerated value should be a power of two
[Flags]
public enum DebugLevel
{
DEBUG_NOTHING = 0x0,
DEBUG_WARN = 0x1,
DEBUG_ERROR = 0x2,
DEBUG_EXCEPTION = 0x4,
DEBUG_INFO = 0x8
}
#if UNITY_EDITOR
public static DebugLevel m_eunmDebugLevel =
DebugLevel.DEBUG_WARN |
DebugLevel.DEBUG_ERROR |
DebugLevel.DEBUG_EXCEPTION |
DebugLevel.DEBUG_INFO;
#else
//public static DebugLevel m_eunmDebugLevel = DebugLevel.DEBUG_NOTHING;
public static DebugLevel m_eunmDebugLevel =
DebugLevel.DEBUG_WARN |
DebugLevel.DEBUG_ERROR |
DebugLevel.DEBUG_EXCEPTION |
DebugLevel.DEBUG_INFO;
#endif
public static void SetDebugLoggingLevel(DebugLevel eLevel)
{
m_eunmDebugLevel = eLevel;
}
[System.Diagnostics.Conditional("DEBUG")]
public static void ClearConsole()
{
Debug.ClearDeveloperConsole();
}
[System.Diagnostics.Conditional("DEBUG")]
public static void w(object cMessage)
{
if ((m_eunmDebugLevel & DebugLevel.DEBUG_WARN) != 0)
{
Debug.LogWarning(WARN_MESSAGE + cMessage);
}
}
[System.Diagnostics.Conditional("DEBUG")]
public static void e(object cMessage)
{
if ((m_eunmDebugLevel & DebugLevel.DEBUG_ERROR) != 0)
{
Debug.LogError(ERROR_MESSAGE + cMessage);
}
}
[System.Diagnostics.Conditional("DEBUG")]
public static void exception(object cMessage)
{
if ((m_eunmDebugLevel & DebugLevel.DEBUG_EXCEPTION) != 0)
{
Debug.LogException(new Exception(EXCEPTION_MESSAGE + cMessage));
}
}
[System.Diagnostics.Conditional("DEBUG")]
public static void d(object cMessage)
{
if ((m_eunmDebugLevel & DebugLevel.DEBUG_INFO) != 0)
{
Debug.Log(INFO_MESSAGE + cMessage);
}
}
[System.Diagnostics.Conditional("DEBUG")]
public static void Assert(bool condition)
{
UnityEngine.Assertions.Assert.IsTrue(condition);
}
}
2016년 1월 30일 토요일
피드 구독하기:
글 (Atom)
-
대상이 되는 이미지를 SVG(Scalable Vector Graphics) 이미지로 변환 - 각종 툴이나 웹상에서 바로 바꿔주는 다양한 방법이 있음(검색 검색~) - 찾은거 하나 : http://image.online-convert.com/c...
-
MQTT mosquitto 서버 설치와 간이 테스트 https://mosquitto.org 모스키토 설치 brew install mosquitto 모스키토 서비스 실행 brew services start mosquitto 모스키...
-
mitmproxy( man in the middle proxy) 설치 메모 https://mitmproxy.org/ 에서 설치 방법 확인 brew를 사용해서 설치 진행 - $ brew install mitmproxy - 설치후...