From 20ea1d78c4e4d1936ee087fc18382c2b60f627e7 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Sun, 30 Apr 2017 17:37:21 +0200 Subject: [PATCH] Improve default summary readability. Now that we have fixed the output of the per-table total timing, we can only show that timing by default. With more verbosity pgloader will add the extra columns, and in computer oriented formats (json, csv, copy) all the details are always provided of course. See #506. --- src/utils/report.lisp | 18 ++++++++++++++++-- src/utils/state.lisp | 3 +++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/utils/report.lisp b/src/utils/report.lisp index 9458a66..f0076e1 100644 --- a/src/utils/report.lisp +++ b/src/utils/report.lisp @@ -19,6 +19,16 @@ (defvar *header-format-strings* '((:human-readable + (:header "~&" + :footer "~%" + :end-of-line-format "~%" + :header-line "~&~v@{~A~:*~} --------- --------- --------- --------------" + :header-tname-format "~&~v@a" + :header-stats-format " ~9@a ~9@a ~9@a ~14@a ~*~*" + :header-cols-format "~&~v@a ~9@a ~9@a ~9@a ~14@a" + :header-cols-names ("table name" "read" "imported" "errors" "total time"))) + + (:human-readable-verbose (:header "~&" :footer "~%" :end-of-line-format "~%" @@ -191,8 +201,12 @@ (pre (getf sections :pre)) (post (getf sections :post)) - (stype (or (parse-summary-type *summary-pathname*) - :human-readable)) + (stype (or (parse-summary-type *summary-pathname*) + (if (member *client-min-messages* + '(:notice :sql :info :debug :data)) + :human-readable-verbose + :human-readable))) + (*header* (get-format-for stype :header)) (*footer* (get-format-for stype :footer)) (*end-of-line-format* (get-format-for stype :end-of-line-format)) diff --git a/src/utils/state.lisp b/src/utils/state.lisp index c362734..bd2caad 100644 --- a/src/utils/state.lisp +++ b/src/utils/state.lisp @@ -85,6 +85,9 @@ ;; maintain the ordering (push label (pgstate-tabnames pgstate)) + (when (typep label 'table) + (pgtable-initialize-reject-files pgtable (table-name label))) + pgtable))) (defun pgstate-setf (pgstate name &key read rows errs secs rs ws)