Skip to content

Instantly share code, notes, and snippets.

@Voresh
Created December 4, 2018 20:11
Show Gist options
  • Select an option

  • Save Voresh/5ee00ca9dcd9848e5261650e8acbf74c to your computer and use it in GitHub Desktop.

Select an option

Save Voresh/5ee00ca9dcd9848e5261650e8acbf74c to your computer and use it in GitHub Desktop.
Unity conditional debug
using System.Diagnostics;
using Debug = UnityEngine.Debug;
public static class ConditionalDebug
{
[Conditional("ENABLE_CONDITIONAL_DEBUG")]
public static void Log(object message)
{
Debug.Log(message);
}
[Conditional("ENABLE_CONDITIONAL_DEBUG")]
public static void LogError(object message)
{
Debug.LogError(message);
}
[Conditional("ENABLE_CONDITIONAL_DEBUG")]
public static void LogWarning(object message)
{
Debug.LogWarning(message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment