기술/유니티 스터디
Unity Debug.cs
송현국
2023. 6. 30. 10:50
반응형
릴리스 빌드에서 모든 로깅을 비활성화하는 방법은 무엇입니까? - 질문과 답변 - Unity 토론
How to disable all logging on release build?
you better use (Tested on Unity2019.4) #if !(DEVELOPMENT_BUILD || UNITY_EDITOR) Debug.unityLogger.filterLogType = LogType.Exception; #endif or use #if !(DEVELOPMENT_BUILD || UNITY_EDITOR) Debug.unityLogger.logEnabled = false; #endif
discussions.unity.com
#define DEBUG
//#if UNITY_EDITOR
//#endif
DEBUG를 주석 해제 하고
Project Settings에서 스크립팅 정의 심볼에 [+] DEBUG를 해주어야 디버그를 활성화 할 수 있다.
public class Debug
{
[Conditional("DEBUG")]
public static void Log(object message)
{
UnityEngine.Debug.Log(message);
}
}
디버그를 비활성화 하는 것도 좋은데 디버그 메시지를 보아야 할 때 보이지 않으면 당황스러울 수 있다.
반응형