[eluser]summanerd[/eluser]
Depends on where you want to see the error. The simplest & quickest way I do it is using PHP's stack trace like so (taken from PHP manual):
Code:
try {
test();
} catch(Exception $e) {
var_dump($e->getTrace());
}
If you want to see it in your logs instead of on the screen I use CI's log function and jsonencode the results of the stack trace.
Code:
try {
test();
} catch(Exception $e) {
log_message("error", json_encode($e->getTrace()));
}
The second option can remain in the code, but the first will need to be removed after testing is complete.
Let me know if this makes sense.