Drupal core (versions 7 and 8.x) has a blacklist of functions that are removed from the backtrace when determining the last caller. These are array('debug', '_drupal_error_handler', '_drupal_exception_handler')
.
Contrib modules that provide their own error handler, such as Raven, and then call the Drupal error handler, need a means to add a function to this blacklist. Otherwise the contrib module's error handler shows up in the Drupal error log as the last caller.