Skip to content

Instantly share code, notes, and snippets.

@maritaria
Created February 2, 2016 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maritaria/24471d30c5bff6990a44 to your computer and use it in GitHub Desktop.
Save maritaria/24471d30c5bff6990a44 to your computer and use it in GitHub Desktop.
Better logger for unity
using System.Diagnostics;
namespace HotBot.Core
{
public static class _DeleteMe
{
[Conditional("UNITY_EDITOR")]//Make sure its the correct one
public static void Log(string format, params object[] args)
{
//Code that logs stuff
Debugger.Log(0, "Debug", string.Format(format, args));
}
public static void Example_Before()
{
#ifdef UNITY_EDITOR
Debugger.Log(0, "Debug", "Hello world!");
#endif
}
public static void Example_After()
{
_DeleteMe.Log("Hello {0}", "World");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment