]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
- When a run of Alembic command line fails due to ``CommandError``,
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 12 Jun 2014 14:30:14 +0000 (10:30 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 12 Jun 2014 14:30:14 +0000 (10:30 -0400)
the output now prefixes the string with ``"FAILED:"``, and the error
is also written to the log output using ``log.error()``.
fixes #209

alembic/util.py
docs/build/changelog.rst

index 63e92690f9f196f975a098d8c71fd00289545fbe..8c02d570939fa092f02f6d3bca273fe7a350772a 100644 (file)
@@ -33,6 +33,8 @@ if not sqla_07:
 from sqlalchemy.util import format_argspec_plus, update_wrapper
 from sqlalchemy.util.compat import inspect_getfullargspec
 
+import logging
+log = logging.getLogger(__name__)
 
 try:
     import fcntl
@@ -172,7 +174,8 @@ def status(_statmsg, fn, *arg, **kw):
         raise
 
 def err(message):
-    msg(message)
+    log.error(message)
+    msg("FAILED: %s" % message)
     sys.exit(-1)
 
 def obfuscate_url_pw(u):
index 89d945e007d0bf79bd0a11575eb1d91502eb6b6d..2d84283cb219239673ce37fba60dab1f026e5a13 100644 (file)
@@ -5,6 +5,14 @@ Changelog
 .. changelog::
     :version: 0.6.6
 
+    .. change::
+      :tags: enhancement
+      :tickets: 209
+
+      When a run of Alembic command line fails due to ``CommandError``,
+      the output now prefixes the string with ``"FAILED:"``, and the error
+      is also written to the log output using ``log.error()``.
+
     .. change::
       :tags: bug
       :tickets: 208