logtail-python 0.3.4__py2.py3-none-any.whl → 0.4.0__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 +1 -1
- logtail/flusher.py +13 -3
- {logtail_python-0.3.4.dist-info → logtail_python-0.4.0.dist-info}/METADATA +8 -6
- {logtail_python-0.3.4.dist-info → logtail_python-0.4.0.dist-info}/RECORD +7 -7
- {logtail_python-0.3.4.dist-info → logtail_python-0.4.0.dist-info}/WHEEL +1 -1
- {logtail_python-0.3.4.dist-info → logtail_python-0.4.0.dist-info}/licenses/LICENSE.md +0 -0
- {logtail_python-0.3.4.dist-info → logtail_python-0.4.0.dist-info}/top_level.txt +0 -0
logtail/__init__.py
CHANGED
logtail/flusher.py
CHANGED
|
@@ -26,6 +26,16 @@ class FlushWorker(threading.Thread):
|
|
|
26
26
|
while self.should_run:
|
|
27
27
|
self.step()
|
|
28
28
|
|
|
29
|
+
def _is_parent_alive(self):
|
|
30
|
+
try:
|
|
31
|
+
return self.parent_thread.is_alive()
|
|
32
|
+
except RuntimeError:
|
|
33
|
+
# Starting with Python 3.14, calling is_alive() on an
|
|
34
|
+
# already-terminated thread raises a RuntimeError instead of
|
|
35
|
+
# returning False (see the parent thread being torn down during
|
|
36
|
+
# interpreter shutdown). Treat that as "no longer alive".
|
|
37
|
+
return False
|
|
38
|
+
|
|
29
39
|
def step(self):
|
|
30
40
|
last_flush = time.time()
|
|
31
41
|
time_remaining = _initial_time_remaining(self.flush_interval)
|
|
@@ -34,7 +44,7 @@ class FlushWorker(threading.Thread):
|
|
|
34
44
|
|
|
35
45
|
# If the parent thread has exited but there are still outstanding
|
|
36
46
|
# events, attempt to send them before exiting.
|
|
37
|
-
shutdown = not self.
|
|
47
|
+
shutdown = not self._is_parent_alive()
|
|
38
48
|
|
|
39
49
|
# Fill phase: take events out of the queue and group them for sending.
|
|
40
50
|
# Takes up to `buffer_capacity` events out of the queue and groups them
|
|
@@ -54,11 +64,11 @@ class FlushWorker(threading.Thread):
|
|
|
54
64
|
except queue.Empty:
|
|
55
65
|
if shutdown or self._flushing:
|
|
56
66
|
break
|
|
57
|
-
shutdown = not self.
|
|
67
|
+
shutdown = not self._is_parent_alive()
|
|
58
68
|
time_remaining = _calculate_time_remaining(last_flush, self.flush_interval)
|
|
59
69
|
|
|
60
70
|
# Send phase: takes the outstanding events (up to `buffer_capacity`
|
|
61
|
-
# count) and sends them to the
|
|
71
|
+
# count) and sends them to the Better Stack endpoint all at once. If the
|
|
62
72
|
# request fails in a way that can be retried, it is retried with an
|
|
63
73
|
# exponential backoff in between attempts.
|
|
64
74
|
if frame:
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: logtail-python
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 0.4.0
|
|
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.
|
|
6
|
+
Download-URL: https://github.com/logtail/logtail-python/tarball/0.4.0
|
|
7
7
|
Author: Logtail
|
|
8
8
|
Author-email: hello@logtail.com
|
|
9
9
|
License: ISC
|
|
@@ -12,13 +12,14 @@ Classifier: Intended Audience :: Developers
|
|
|
12
12
|
Classifier: License :: OSI Approved :: ISC License (ISCL)
|
|
13
13
|
Classifier: Operating System :: OS Independent
|
|
14
14
|
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
18
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
19
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
20
|
Classifier: Programming Language :: Python
|
|
21
21
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Requires-Python: >=3.10
|
|
22
23
|
Description-Content-Type: text/markdown
|
|
23
24
|
License-File: LICENSE.md
|
|
24
25
|
Requires-Dist: requests>=2.18.4
|
|
@@ -34,6 +35,7 @@ Dynamic: keywords
|
|
|
34
35
|
Dynamic: license
|
|
35
36
|
Dynamic: license-file
|
|
36
37
|
Dynamic: requires-dist
|
|
38
|
+
Dynamic: requires-python
|
|
37
39
|
Dynamic: summary
|
|
38
40
|
|
|
39
41
|
# [Better Stack](https://betterstack.com/logs) Python client
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
logtail/__init__.py,sha256=
|
|
1
|
+
logtail/__init__.py,sha256=lz_ouCpEkpsK8Lq9fCQ7Sqj8xbowot6JzNZGFeEfOrI,252
|
|
2
2
|
logtail/compat.py,sha256=KbZmcmDpj_vbMotp16pADPwJ1FkEHGDNjKbOfCy-c10,141
|
|
3
|
-
logtail/flusher.py,sha256=
|
|
3
|
+
logtail/flusher.py,sha256=KKb4IEuPC_XGKaNBrbMEiwc-X4MKsYURPjY7PqR3v4k,4176
|
|
4
4
|
logtail/formatter.py,sha256=nk4W1G95P19ijylPBJ8D9FlO_qbh3tfbv7xzCSfpDN8,968
|
|
5
5
|
logtail/frame.py,sha256=p7vVYcajZvjH4FJDt4ADLfYljVbQXKTGKk3kFec5JUs,3335
|
|
6
6
|
logtail/handler.py,sha256=9PNJPSc2S3W5uQADKE4iDFH16A7BZW90D-m7aR66Mo4,3188
|
|
7
7
|
logtail/helpers.py,sha256=ezDTLsTBAtCtIh_XptSYOiBrZFa-E9wo2SWTnjKgOOU,1156
|
|
8
8
|
logtail/uploader.py,sha256=Ilhh8wuAGlz1YJcQpzXtFqwD-2RYmuamKv3dFNoTWUg,868
|
|
9
|
-
logtail_python-0.
|
|
10
|
-
logtail_python-0.
|
|
11
|
-
logtail_python-0.
|
|
12
|
-
logtail_python-0.
|
|
13
|
-
logtail_python-0.
|
|
9
|
+
logtail_python-0.4.0.dist-info/licenses/LICENSE.md,sha256=aCBMqxfm7QNyFR9JiJ2GSMvhAURXN2E0yTcYNQloqI0,737
|
|
10
|
+
logtail_python-0.4.0.dist-info/METADATA,sha256=Bwsctru3-I0ZkrvKuukF6j1jDB7P1nz5OYyBmBsw79M,2429
|
|
11
|
+
logtail_python-0.4.0.dist-info/WHEEL,sha256=TdQ5LtNwLuxTCjgxN51AgdU5w-KkB9ttmLbzjTH02pg,109
|
|
12
|
+
logtail_python-0.4.0.dist-info/top_level.txt,sha256=QZIbQogN1yFBgjiJ-8NlYArVCL00gBoYbEUT_Ew8l-Q,8
|
|
13
|
+
logtail_python-0.4.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|