<p>If I write some mlpack code and have a snippet like</p>

<pre><code>Log::Fatal &lt;&lt; "Something is wrong!" &lt;&lt; std::endl;
</code></pre>

<p>then the user just sees</p>

<pre><code>[FATAL] Something is wrong!
</code></pre>

<p>One way to combat this is to give basic traces:</p>

<pre><code>Log::Fatal &lt;&lt; "Class::Method(): Something is wrong!" &lt;&lt; std::endl;
</code></pre>

<p>but this leaves a lot to be desired, especially because <code>Class::Method()</code> may be somewhere deep inside of an algorithm where the user won't recognize the name of it, and thus will have no idea what's wrong.  If instead, they got some kind of backtrace, it would be quite helpful, i.e.</p>

<pre><code>[FATAL] Something is wrong!
[FATAL]
[FATAL] In Class::Method(), called by
[FATAL]  OtherClass::OtherMethod(), called by
...
</code></pre>

<p><code>Log::Assert()</code> in <code>src/mlpack/core/util/log.cpp</code> has a basic attempt to obtain a backtrace, but I suspect there is an easier way to do it.  (Maybe throwing an exception?)</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/mlpack/mlpack/issues/380">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFBpTMVYnw1Au2bd6hgD_7Fo1CciWks5nhEQHgaJpZM4DRaYY.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
  <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
    <link itemprop="url" href="https://github.com/mlpack/mlpack/issues/380"></link>
    <meta itemprop="name" content="View Issue"></meta>
  </div>
  <meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>