escape newlines in log messages