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);
    }
}
피드 구독하기:
댓글 (Atom)
- 
대상이 되는 이미지를 SVG(Scalable Vector Graphics) 이미지로 변환 - 각종 툴이나 웹상에서 바로 바꿔주는 다양한 방법이 있음(검색 검색~) - 찾은거 하나 : http://image.online-convert.com/c...
- 
mitmproxy( man in the middle proxy) 설치 메모 https://mitmproxy.org/ 에서 설치 방법 확인 brew를 사용해서 설치 진행 - $ brew install mitmproxy - 설치후...
- 
CommandBuffer를 사용하여 Gray Post Effect 효과를 적용해보는 Simple code... 일단 보여지는 결과는... 실행전 실행후 CommmandBuffer를 이용한 C#예제 소스 using ...
 
 
 
 
댓글 없음:
댓글 쓰기