title: Skip particular method from showing up in stacktrace
body: <p>I have been trying to get a reliable way of printing the stack trace at runtime on mobile devices. I came across <code>System.Environment.StackTrace</code></p>
  
  <p>I am trying something with 3 classes right now:</p>
  
  <pre><code>public class Test : MonoBehaviour {
      public static void Do() {
          Test3.ActionThing(() =&gt; {
              Test2.DoSomethingElse();
          });
      }
  }
  
  
  public class Test2 : MonoBehaviour {
      void Start () {
          Test3.ActionThing(() =&gt; {
              Debug.Log("Start execution");
              Test.Do();
          });
      }
  
      public static void DoSomethingElse(){
          Test3.ActionThing(() =&gt; {
              var a = 0;
              a = int.Parse("s1");
          });
      }
  }
  
  public class Test3 : MonoBehaviour {
      public static void ActionThing(Action act){
          try{
              if (act != null)
                  act();
          }catch(Exception e){
              Debug.LogError("Error occured " + e.Message);
              Debug.LogError("StackTrace was " + Environment.StackTrace);
          }
      }
  }
  </code></pre>
  
  <p>I get this stacktrace when the error is thrown</p>
  
  <pre><code>StackTrace was    at System.Environment.get_StackTrace() in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Environment.cs:line 227
     at Test3.ActionThing(System.Action act) in &lt;ProjectPath&gt;\Test3.cs:line 13
     at Test2.DoSomethingElse() in &lt;ProjectPath&gt;\Test2.cs:line 14
     at Test.&lt;Do&gt;m__0() in &lt;ProjectPath&gt;\Test.cs:line 8
     at Test3.ActionThing(System.Action act) in &lt;ProjectPath&gt;\Test3.cs:line 10
     at Test.Do() in &lt;ProjectPath&gt;\Test.cs:line 7
     at Test2.&lt;Start&gt;m__0() in &lt;ProjectPath&gt;\Test2.cs:line 9
     at Test3.ActionThing(System.Action act) in &lt;ProjectPath&gt;\Test3.cs:line 10
     at Test2.Start() in &lt;ProjectPath&gt;\Test2.cs:line 7
  UnityEngine.Debug:LogError(Object)
  Test3:ActionThing(Action) (at Assets/Test3.cs:13)
  Test2:DoSomethingElse() (at Assets/Test2.cs:14)
  Test:&lt;Do&gt;m__0() (at Assets/Test.cs:8)
  Test3:ActionThing(Action) (at Assets/Test3.cs:10)
  Test:Do() (at Assets/Test.cs:7)
  Test2:&lt;Start&gt;m__0() (at Assets/Test2.cs:9)
  Test3:ActionThing(Action) (at Assets/Test3.cs:10)
  Test2:Start() (at Assets/Test2.cs:7)
  </code></pre>
  
  <p>Obviously, since I want this to be a Debug in the release build, it wont show the internal stack trace, and only the message.</p>
  
  <p>But the problem lies in the stacktrace itself, where it even prints the method <code>at Test3.ActionThing(System.Action act) in &lt;ProjectPath&gt;\Test3.cs:line 10</code>. I want to skip this from showing up in the stack trace.</p>
  
  <p>&nbsp;</p>
  
  <p>Any help appreciated, thanks in advance. If the question seems too long, please suggest edits :)</p>