Improve formatting of log messages