logtail-python 0.5.1__py2.py3-none-any.whl → 0.5.2__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
logtail/__init__.py CHANGED
@@ -5,7 +5,7 @@ from .handler import LogtailHandler
5
5
  from .helpers import LogtailContext, DEFAULT_CONTEXT
6
6
  from .formatter import LogtailFormatter
7
7
 
8
- __version__ = '0.5.1'
8
+ __version__ = '0.5.2'
9
9
 
10
10
  context = DEFAULT_CONTEXT
11
11
 
logtail/flusher.py CHANGED
@@ -89,13 +89,13 @@ class FlushWorker(threading.Thread):
89
89
  if delay is not None:
90
90
  time.sleep(delay)
91
91
 
92
- # A network error surfaces as a Fake500 that carries an `exception`
93
- # attribute; a genuine server HTTP 500 is a real `requests.Response`
94
- # that has no such attribute. Use a default so the latter doesn't
95
- # raise AttributeError here and kill the flush thread (dropping all
96
- # subsequent logs for the life of the process).
97
- if response.status_code == 500 and getattr(response, "exception", None) is not None:
98
- print('Failed to send logs to Better Stack after {} retries: {}'.format(len(RETRY_SCHEDULE), response.exception))
92
+ # The batch is dropped once the retries run out. A network error
93
+ # surfaces as a Fake500 that carries the `exception`; a 5xx answer
94
+ # from the server is a real `requests.Response` without one, so it
95
+ # is reported by its status code instead.
96
+ if _should_retry(response.status_code):
97
+ reason = getattr(response, 'exception', 'HTTP {}'.format(response.status_code))
98
+ print('Failed to send logs to Better Stack after {} retries: {}'.format(len(RETRY_SCHEDULE), reason))
99
99
 
100
100
  self._clean = True
101
101
  if shutdown and self.pipe.empty():
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: logtail-python
3
- Version: 0.5.1
3
+ Version: 0.5.2
4
4
  Summary: Better Stack client library
5
5
  Home-page: https://github.com/logtail/logtail-python
6
- Download-URL: https://github.com/logtail/logtail-python/tarball/0.5.1
6
+ Download-URL: https://github.com/logtail/logtail-python/tarball/0.5.2
7
7
  Author: Logtail
8
8
  Author-email: hello@logtail.com
9
9
  License: ISC
@@ -1,6 +1,6 @@
1
- logtail/__init__.py,sha256=kLT8EljGsSHhgGrzGLxzvRdCdhsq1rzHHwPrY-AvyKI,365
1
+ logtail/__init__.py,sha256=dSkTiyIZ5aAwjXgNzehhrO3-SQrJbJScOpGC4WQgMeI,365
2
2
  logtail/compat.py,sha256=JjanLon30OWIVy1ndbVWh2puBpp3Z9DXDH4-2k3NlrE,184
3
- logtail/flusher.py,sha256=Gmx90AIkL5yk4D_M_tYq-HuDeYDMjp0Hc-BiDnOC1BU,6242
3
+ logtail/flusher.py,sha256=b9ICw0XrDDDsdGJ7HWEzg8eSrXlociQHd3I4Cg63S9Q,6191
4
4
  logtail/formatter.py,sha256=k0MxcH7NhcBEIV7rj6-hc3oDJCzc9_JKeR_rY92GJOw,1149
5
5
  logtail/frame.py,sha256=Liv6qJqyW1XAwF60VX35gJ7c9HF5fwd4liveEnvLEkM,3945
6
6
  logtail/handler.py,sha256=JN3eaTFaf2Ma23TQK0728UXvhsUzDUGVx9Zno_uNlxI,5376
@@ -8,8 +8,8 @@ logtail/helpers.py,sha256=ZlTJ9dTFJOD5PEkcVXBBs9QrN-bWIEu1gOnO0NFO3Qo,1442
8
8
  logtail/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  logtail/rq.py,sha256=N2BzwljCgNulzYGy_z8r5BAlAvFslof5deID-Rc3gNc,1076
10
10
  logtail/uploader.py,sha256=KjyXTsrZ1AZi3zyDL21nzyd3MD9xeC1XG6vRtVQmLV4,2068
11
- logtail_python-0.5.1.dist-info/licenses/LICENSE.md,sha256=aCBMqxfm7QNyFR9JiJ2GSMvhAURXN2E0yTcYNQloqI0,737
12
- logtail_python-0.5.1.dist-info/METADATA,sha256=s-mLwNEY8Qd4xG8EjkXNMp9Ub_gV5vbrmdQ5Zx8DPbs,2480
13
- logtail_python-0.5.1.dist-info/WHEEL,sha256=4YBfCYNH4wlLpv3pzq1hbEuIlXA4WJabKLFurZ7eTL0,109
14
- logtail_python-0.5.1.dist-info/top_level.txt,sha256=QZIbQogN1yFBgjiJ-8NlYArVCL00gBoYbEUT_Ew8l-Q,8
15
- logtail_python-0.5.1.dist-info/RECORD,,
11
+ logtail_python-0.5.2.dist-info/licenses/LICENSE.md,sha256=aCBMqxfm7QNyFR9JiJ2GSMvhAURXN2E0yTcYNQloqI0,737
12
+ logtail_python-0.5.2.dist-info/METADATA,sha256=Fc0rkgjnW4gH0LHc-DiJp99BIwTVycZ_ILKhCbAdq2k,2480
13
+ logtail_python-0.5.2.dist-info/WHEEL,sha256=4YBfCYNH4wlLpv3pzq1hbEuIlXA4WJabKLFurZ7eTL0,109
14
+ logtail_python-0.5.2.dist-info/top_level.txt,sha256=QZIbQogN1yFBgjiJ-8NlYArVCL00gBoYbEUT_Ew8l-Q,8
15
+ logtail_python-0.5.2.dist-info/RECORD,,