[mlpack-git] [mlpack] Log::Fatal should give a backtrace of some sort (#380)

Ryan Curtin notifications at github.com
Mon Jan 12 17:36:55 EST 2015


If I write some mlpack code and have a snippet like

```
Log::Fatal << "Something is wrong!" << std::endl;
```

then the user just sees

```
[FATAL] Something is wrong!
```

One way to combat this is to give basic traces:

```
Log::Fatal << "Class::Method(): Something is wrong!" << std::endl;
```

but this leaves a lot to be desired, especially because `Class::Method()` 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.

```
[FATAL] Something is wrong!
[FATAL]
[FATAL] In Class::Method(), called by
[FATAL]  OtherClass::OtherMethod(), called by
...
```

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

---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/issues/380
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20150112/7e9cf0b7/attachment.html>


More information about the mlpack-git mailing list