Refactor logging format and dialog error messages