From 0702291c26f26b1ce719aee46811d924fa7815cf Mon Sep 17 00:00:00 2001 From: jar3b Date: Fri, 23 Aug 2019 11:08:50 +0300 Subject: [PATCH] fix: use BaseException instead of Exception, up to 0.1.2 --- README.md | 12 ++++++++++++ logag_handler/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c3320d4..9910693 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,16 @@ ``` git+https://gitlab.com/logag/logag-python-handler.git +``` + +in code: +```python +import logging +from xid import Xid + +log = logging.getLogger() +try: + a = 1/0 +except Exception as e: + log.warning("Test", exc_info=e, extra={'request_id': "123123123", 'xid': Xid().string}) ``` \ No newline at end of file diff --git a/logag_handler/__init__.py b/logag_handler/__init__.py index 68da062..d2b492c 100644 --- a/logag_handler/__init__.py +++ b/logag_handler/__init__.py @@ -63,5 +63,5 @@ class LogagHandler(logging.Handler): } self.__send_to_udp(json_) - except Exception as e: + except BaseException as e: self.backup_handler.emit(record) diff --git a/setup.py b/setup.py index 5f7cd9c..d20cb12 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup( name='logag-python-handler', - version='0.1.1', + version='0.1.2', packages=['logag_handler'], url='https://gitlab.com/logag/logag-python-handler', license='MIT',