Add log entries for connection strings.

It helps a lot to debug what's happening, and it seems that we lost the
information when cleaning up the log levels in recent efforts to unclutter
the default output.
This commit is contained in:
Dimitri Fontaine 2017-11-02 12:37:30 +01:00
parent 501762d2f5
commit 6b6c1c7d34
2 changed files with 8 additions and 1 deletions

View File

@ -265,6 +265,8 @@
alter-schema
materialize-views)
"Export database source data and Import it into PostgreSQL"
(log-message :log "Migrating from ~a" (source-db copy))
(log-message :log "Migrating into ~a" (target-db copy))
(let* ((*on-error-stop* on-error-stop)
(copy-data (or data-only (not schema-only)))
(create-ddl (or schema-only (not data-only)))

View File

@ -112,7 +112,12 @@
(defmethod print-object ((c db-connection) stream)
(print-unreadable-object (c stream :type t :identity t)
(with-slots (type name host port user) c
(format stream "~a://~a@~a:~a/~a" type user host port name))))
(let ((host (typecase host
(cons (format nil "~a:~a"
(string-downcase (car host))
(cdr host)))
(t host))))
(format stream "~a://~a@~a:~a/~a" type user host port name)))))
(define-condition db-connection-error (connection-error)
((host :initarg :host :reader connection-error-host)