Print the stacktrace if we are in debug mode.