Trace output should convert newlines, tabs, non-printing chars to escaped representation
Trace output is hard to read when it contains newlines. Perhaps it should escape the output using the same mechanism used when outputting JSON, such as '\n' for newline, etc.