Make stack trace printing optional