format stacktrace output