Formatting stack traces for console output.