From 0f62751a3f07d2d247268829f1269ce4e12d92d7 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Tue, 29 Apr 2014 11:42:02 +0200 Subject: [PATCH] Improve summary output. Try at having a deterministic ouput of it, which still apparently is not always the case when using SBCL, now that it's been switched to using the explicit *terminal-io* rather than t. This change is needed for CCL support, though, where you don't get to write to the same stream from different threads. --- src/utils.lisp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/utils.lisp b/src/utils.lisp index 87a7a32..427bcfe 100644 --- a/src/utils.lisp +++ b/src/utils.lisp @@ -161,20 +161,26 @@ (defvar *header-cols-names* '("table name" "read" "imported" "errors" "time")) (defun report-header () - (apply #'format t *header-cols-format* *header-cols-names*) - (format t *header-line*)) + (apply #'format *terminal-io* *header-cols-format* *header-cols-names*) + (terpri) + (format *terminal-io* *header-line*) + (terpri)) (defun report-table-name (table-name) - (format t *header-tname-format* table-name)) + (format *terminal-io* *header-tname-format* table-name)) (defun report-results (read rows errors seconds) - (format t *header-stats-format* read rows errors (format-interval seconds nil))) + (format *terminal-io* *header-stats-format* + read rows errors (format-interval seconds nil)) + (terpri)) (defun report-footer (legend read rows errors seconds) - (format t *header-line*) - (apply #'format t *header-cols-format* + (terpri) + (format *terminal-io* *header-line*) + (apply #'format *terminal-io* *header-cols-format* (list legend read rows errors (format-interval seconds nil))) - (format t "~&")) + (format *terminal-io* "~&") + (terpri)) ;;; ;;; Pretty print a report from a pgtable and pgstats counters