fixed format strings and logging exceptions