The debug output goes to STDERR (when on a TTY, they are printed in blue)
debug/3 also tries to prepend the output with
% but only succeeds on the first line!
This should (possibly) be corrected.
?- debug(toplevel). Warning: toplevel: no matching debug topic (yet) true. ?- debug(toplevel,"This is multiline: ~q\n~q\n~q",[alpha,bravo,charlie]). % This is multiline: alpha bravo charlie true.