Adds string escaping for invalid line logging