From: Mike Bayer Date: Thu, 12 Jun 2014 14:30:14 +0000 (-0400) Subject: - When a run of Alembic command line fails due to ``CommandError``, X-Git-Tag: rel_0_6_6~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42b109c414aca7b1cf9069c1e1168a20dea3b343;p=thirdparty%2Fsqlalchemy%2Falembic.git - 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()``. fixes #209 --- diff --git a/alembic/util.py b/alembic/util.py index 63e92690..8c02d570 100644 --- a/alembic/util.py +++ b/alembic/util.py @@ -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): diff --git a/docs/build/changelog.rst b/docs/build/changelog.rst index 89d945e0..2d84283c 100644 --- a/docs/build/changelog.rst +++ b/docs/build/changelog.rst @@ -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