Skip to content

Instantly share code, notes, and snippets.

Created August 7, 2013 18:04
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Abusing reflection and the internal Unity player build error function to get stacktrace-less error logs. Not recommended for anything sane.
using UnityEngine;
using System.Reflection;
public class TerriblyHackyLog : MonoBehaviour
void Start ()
Log ("Aaaaarrrrgh!");
static void Log (string message)
typeof (Debug).GetMethod (
BindingFlags.Static | BindingFlags.InvokeMethod | BindingFlags.NonPublic
).Invoke (
new object[]{message, "", 0, 0}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment