--- a/src/lsp/trace.lsp
+++ b/src/lsp/trace.lsp
@@ -148,35 +148,38 @@
 
 (defun trace-print (direction fname vals &rest extras)
   (let ((indent (min (* (1- *trace-level*) 2) *trace-max-indent*))
-	(*print-circle* t))
-    (fresh-line *trace-output*)
-    (case direction
-      (ENTER
-       (multiple-value-bind (bars rem)
-	   (floor indent 4)
-	 (dotimes (i bars) (princ (if (< i 10) "|   " "|    ") *trace-output*))
-	 (when (plusp rem) (format *trace-output* "~V,,,' A" rem "|")))
-       (format *trace-output*
-	       "~D> (~S~{ ~S~})~%"
-	       *trace-level* fname vals))
-      (EXIT
-       (multiple-value-bind (bars rem)
-	   (floor indent 4)
-	 (dotimes (i bars) (princ "|   " *trace-output*))
-	 (when (plusp rem) (format *trace-output* "~V,,,' A" rem "|")))
-       (format *trace-output*
-	       "<~D (~S~{ ~S~})~%"
-	       *trace-level*
-	       fname vals)
-       ))
-    (when extras
-      (multiple-value-bind (bars rem)
-	  (floor indent 4)
-	(dotimes (i bars) (princ "|   " *trace-output*))
-	(when (plusp rem) (format *trace-output* "~V,,,' A" rem "|")))
-      (format *trace-output*
-	      "~0,4@T\\\\ ~{ ~S~}~%"
-	      extras))))
+        (*print-circle* t))
+    (princ
+      (with-output-to-string (*trace-output*)
+        (fresh-line *trace-output*)
+        (case direction
+          (ENTER
+            (multiple-value-bind (bars rem)
+              (floor indent 4)
+              (dotimes (i bars) (princ (if (< i 10) "|   " "|    ") *trace-output*))
+              (when (plusp rem) (format *trace-output* "~V,,,' A" rem "|")))
+            (format *trace-output*
+                    "~D> (~S~{ ~S~})~%"
+                    *trace-level* fname vals))
+          (EXIT
+            (multiple-value-bind (bars rem)
+              (floor indent 4)
+              (dotimes (i bars) (princ "|   " *trace-output*))
+              (when (plusp rem) (format *trace-output* "~V,,,' A" rem "|")))
+            (format *trace-output*
+                    "<~D (~S~{ ~S~})~%"
+                    *trace-level*
+                    fname vals)
+            ))
+        (when extras
+          (multiple-value-bind (bars rem)
+            (floor indent 4)
+            (dotimes (i bars) (princ "|   " *trace-output*))
+            (when (plusp rem) (format *trace-output* "~V,,,' A" rem "|")))
+          (format *trace-output*
+                  "~0,4@T\\\\ ~{ ~S~}~%"
+                  extras))
+        *trace-output*))))
 
 (defun trace-record (fname)
   (declare (si::c-local))