The optimizer_trace system variable has these on/off switches:
enabled: allows to enable/disable tracing
one_line: if on, the trace will have no whitespace; it's unreadable for humans but readable for JSON parsers (they ignore whitespace); the only advantage is a saving on space.