Skip to content

Instantly share code, notes, and snippets.

@wackoisgod
Created February 7, 2018 22:54
Show Gist options
  • Save wackoisgod/013322fd59d58f4f3a99297d24a0a895 to your computer and use it in GitHub Desktop.
Save wackoisgod/013322fd59d58f4f3a99297d24a0a895 to your computer and use it in GitHub Desktop.
public class UnityConsoleTraceListener : TextWriterTraceListener
{
public override void Write(string message)
{
UnityEngine.Debug.LogError(message);
base.Write(message);
}
public override void WriteLine(string message)
{
UnityEngine.Debug.LogError(message);
base.WriteLine(message);
}
}
somewhere in Unity Code at the earliest point possible:
System.Diagnostics.Debug.Listeners.Add(new UnityConsoleTraceListener());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment