logtail-python 0.3.1__tar.gz → 0.3.2__tar.gz
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_python-0.3.1/logtail_python.egg-info → logtail_python-0.3.2}/PKG-INFO +2 -2
- {logtail_python-0.3.1 → logtail_python-0.3.2}/logtail/__init__.py +1 -1
- {logtail_python-0.3.1 → logtail_python-0.3.2}/logtail/frame.py +12 -7
- {logtail_python-0.3.1 → logtail_python-0.3.2/logtail_python.egg-info}/PKG-INFO +2 -2
- {logtail_python-0.3.1 → logtail_python-0.3.2}/setup.py +1 -1
- {logtail_python-0.3.1 → logtail_python-0.3.2}/tests/__pycache__/test_handler.cpython-311.pyc +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/tests/test_handler.py +21 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/LICENSE.md +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/MANIFEST.in +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/README.md +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/logtail/compat.py +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/logtail/flusher.py +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/logtail/formatter.py +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/logtail/handler.py +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/logtail/helpers.py +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/logtail/uploader.py +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/logtail_python.egg-info/SOURCES.txt +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/logtail_python.egg-info/dependency_links.txt +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/logtail_python.egg-info/requires.txt +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/logtail_python.egg-info/top_level.txt +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/requirements.txt +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/setup.cfg +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/test-requirements.txt +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/tests/__init__.py +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/tests/__pycache__/__init__.cpython-311.pyc +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/tests/__pycache__/test_flusher.cpython-311.pyc +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/tests/__pycache__/test_formatter.cpython-311.pyc +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/tests/__pycache__/test_frame.cpython-311.pyc +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/tests/__pycache__/test_helpers.cpython-311.pyc +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/tests/__pycache__/test_uploader.cpython-311.pyc +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/tests/test_flusher.py +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/tests/test_formatter.py +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/tests/test_frame.py +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/tests/test_helpers.py +0 -0
- {logtail_python-0.3.1 → logtail_python-0.3.2}/tests/test_uploader.py +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: logtail-python
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: Logtail.com client library
|
|
5
5
|
Home-page: https://github.com/logtail/logtail-python
|
|
6
|
-
Download-URL: https://github.com/logtail/logtail-python/tarball/0.3.
|
|
6
|
+
Download-URL: https://github.com/logtail/logtail-python/tarball/0.3.2
|
|
7
7
|
Author: Logtail
|
|
8
8
|
Author-email: hello@logtail.com
|
|
9
9
|
License: ISC
|
|
@@ -60,23 +60,28 @@ def _parse_custom_events(record, include_extra_attributes):
|
|
|
60
60
|
def _remove_circular_dependencies(obj, memo=None):
|
|
61
61
|
if memo is None:
|
|
62
62
|
memo = set()
|
|
63
|
+
|
|
63
64
|
# Skip immutable types, which can't contain circular dependencies
|
|
64
|
-
if isinstance(obj, (str, int, float, bool)):
|
|
65
|
+
if isinstance(obj, (str, int, float, bool, type(None))):
|
|
65
66
|
return obj
|
|
66
|
-
|
|
67
|
+
|
|
68
|
+
# For mutable objects, check for circular references
|
|
69
|
+
obj_id = id(obj)
|
|
70
|
+
if obj_id in memo:
|
|
67
71
|
return "<omitted circular reference>"
|
|
68
|
-
memo.add(
|
|
72
|
+
memo.add(obj_id)
|
|
73
|
+
|
|
69
74
|
if isinstance(obj, dict):
|
|
70
75
|
new_dict = {}
|
|
71
76
|
for key, value in obj.items():
|
|
72
|
-
new_dict[key] = _remove_circular_dependencies(value, memo)
|
|
77
|
+
new_dict[key] = _remove_circular_dependencies(value, memo.copy())
|
|
73
78
|
return new_dict
|
|
74
79
|
elif isinstance(obj, list):
|
|
75
|
-
return [_remove_circular_dependencies(item, memo) for item in obj]
|
|
80
|
+
return [_remove_circular_dependencies(item, memo.copy()) for item in obj]
|
|
76
81
|
elif isinstance(obj, tuple):
|
|
77
|
-
return tuple(_remove_circular_dependencies(item, memo) for item in obj)
|
|
82
|
+
return tuple(_remove_circular_dependencies(item, memo.copy()) for item in obj)
|
|
78
83
|
elif isinstance(obj, set):
|
|
79
|
-
return {_remove_circular_dependencies(item, memo) for item in obj}
|
|
84
|
+
return {_remove_circular_dependencies(item, memo.copy()) for item in obj}
|
|
80
85
|
else:
|
|
81
86
|
return obj
|
|
82
87
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: logtail-python
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: Logtail.com client library
|
|
5
5
|
Home-page: https://github.com/logtail/logtail-python
|
|
6
|
-
Download-URL: https://github.com/logtail/logtail-python/tarball/0.3.
|
|
6
|
+
Download-URL: https://github.com/logtail/logtail-python/tarball/0.3.2
|
|
7
7
|
Author: Logtail
|
|
8
8
|
Author-email: hello@logtail.com
|
|
9
9
|
License: ISC
|
{logtail_python-0.3.1 → logtail_python-0.3.2}/tests/__pycache__/test_handler.cpython-311.pyc
RENAMED
|
Binary file
|
|
@@ -224,6 +224,27 @@ class TestLogtailHandler(unittest.TestCase):
|
|
|
224
224
|
self.assertEqual(log_entry['test2'], 'this is a test string')
|
|
225
225
|
self.assertTrue(handler.pipe.empty())
|
|
226
226
|
|
|
227
|
+
@patch('logtail.handler.FlushWorker')
|
|
228
|
+
def test_can_have_multiple_instance_of_same_array_in_extra_data(self, MockWorker):
|
|
229
|
+
buffer_capacity = 1
|
|
230
|
+
handler = LogtailHandler(
|
|
231
|
+
source_token=self.source_token,
|
|
232
|
+
buffer_capacity=buffer_capacity
|
|
233
|
+
)
|
|
234
|
+
|
|
235
|
+
logger = logging.getLogger(__name__)
|
|
236
|
+
logger.handlers = []
|
|
237
|
+
logger.addHandler(handler)
|
|
238
|
+
test_array = ['this is a test string']
|
|
239
|
+
logger.info('hello', extra={'test1': test_array, 'test2': test_array})
|
|
240
|
+
|
|
241
|
+
log_entry = handler.pipe.get()
|
|
242
|
+
|
|
243
|
+
self.assertEqual(log_entry['message'], 'hello')
|
|
244
|
+
self.assertEqual(log_entry['test1'], ['this is a test string'])
|
|
245
|
+
self.assertEqual(log_entry['test2'], ['this is a test string'])
|
|
246
|
+
self.assertTrue(handler.pipe.empty())
|
|
247
|
+
|
|
227
248
|
@patch('logtail.handler.FlushWorker')
|
|
228
249
|
def test_can_send_circular_dependency_in_context(self, MockWorker):
|
|
229
250
|
buffer_capacity = 1
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{logtail_python-0.3.1 → logtail_python-0.3.2}/tests/__pycache__/test_flusher.cpython-311.pyc
RENAMED
|
File without changes
|
{logtail_python-0.3.1 → logtail_python-0.3.2}/tests/__pycache__/test_formatter.cpython-311.pyc
RENAMED
|
File without changes
|
|
File without changes
|
{logtail_python-0.3.1 → logtail_python-0.3.2}/tests/__pycache__/test_helpers.cpython-311.pyc
RENAMED
|
File without changes
|
{logtail_python-0.3.1 → logtail_python-0.3.2}/tests/__pycache__/test_uploader.cpython-311.pyc
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|