diff --git a/doc/source/examples/usage.py b/doc/source/examples/usage.py index e09ff036..1afcd36d 100644 --- a/doc/source/examples/usage.py +++ b/doc/source/examples/usage.py @@ -80,4 +80,7 @@ if __name__ == '__main__': LOG.debug("A debugging message") LOG.warning("A warning occurred") LOG.error("An error occurred") - LOG.exception("An Exception occurred") + try: + raise Exception("This is exceptional") + except Exception: + LOG.exception("An Exception occurred") diff --git a/doc/source/examples/usage_helper.py b/doc/source/examples/usage_helper.py index b8fb19a1..dcd76eb0 100644 --- a/doc/source/examples/usage_helper.py +++ b/doc/source/examples/usage_helper.py @@ -97,4 +97,7 @@ if __name__ == '__main__': LOG.debug("A debugging message") LOG.warning("A warning occurred") LOG.error("An error occurred") - LOG.exception("An Exception occurred") + try: + raise Exception("This is exceptional") + except Exception: + LOG.exception("An Exception occurred") diff --git a/doc/source/examples/usage_i18n.py b/doc/source/examples/usage_i18n.py index 820fffda..23c54302 100644 --- a/doc/source/examples/usage_i18n.py +++ b/doc/source/examples/usage_i18n.py @@ -81,4 +81,7 @@ if __name__ == '__main__': LOG.debug("A debugging message") # Debug messages are not translated LOG.warning(_LW("A warning occurred")) LOG.error(_LE("An error occurred")) - LOG.exception(_("An Exception occurred")) + try: + raise Exception(_("This is exceptional")) + except Exception: + LOG.exception(_("An Exception occurred"))