diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-06-12 10:30:14 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-06-12 10:30:14 -0400 |
commit | 42b109c414aca7b1cf9069c1e1168a20dea3b343 (patch) | |
tree | b9d8dc52da7bbcaeff92eba457ffd9017805844b | |
parent | 1f4d8c61033685d90c344c96222e2f8249ca68e8 (diff) | |
download | alembic-42b109c414aca7b1cf9069c1e1168a20dea3b343.tar.gz |
- 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
-rw-r--r-- | alembic/util.py | 5 | ||||
-rw-r--r-- | docs/build/changelog.rst | 8 |
2 files changed, 12 insertions, 1 deletions
diff --git a/alembic/util.py b/alembic/util.py index 63e9269..8c02d57 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 89d945e..2d84283 100644 --- a/docs/build/changelog.rst +++ b/docs/build/changelog.rst @@ -6,6 +6,14 @@ 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 |