liblogging 0.1.8__tar.gz → 0.1.9__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.
- {liblogging-0.1.8 → liblogging-0.1.9}/PKG-INFO +1 -1
- {liblogging-0.1.8 → liblogging-0.1.9}/liblogging/sending/log_collector.py +3 -7
- {liblogging-0.1.8 → liblogging-0.1.9}/liblogging.egg-info/PKG-INFO +1 -1
- {liblogging-0.1.8 → liblogging-0.1.9}/setup.py +1 -1
- {liblogging-0.1.8 → liblogging-0.1.9}/LICENSE +0 -0
- {liblogging-0.1.8 → liblogging-0.1.9}/README.md +0 -0
- {liblogging-0.1.8 → liblogging-0.1.9}/liblogging/__init__.py +0 -0
- {liblogging-0.1.8 → liblogging-0.1.9}/liblogging/logger.py +0 -0
- {liblogging-0.1.8 → liblogging-0.1.9}/liblogging/sending/__init__.py +0 -0
- {liblogging-0.1.8 → liblogging-0.1.9}/liblogging/sending/kafka_service.py +0 -0
- {liblogging-0.1.8 → liblogging-0.1.9}/liblogging/util.py +0 -0
- {liblogging-0.1.8 → liblogging-0.1.9}/liblogging.egg-info/SOURCES.txt +0 -0
- {liblogging-0.1.8 → liblogging-0.1.9}/liblogging.egg-info/dependency_links.txt +0 -0
- {liblogging-0.1.8 → liblogging-0.1.9}/liblogging.egg-info/entry_points.txt +0 -0
- {liblogging-0.1.8 → liblogging-0.1.9}/liblogging.egg-info/top_level.txt +0 -0
- {liblogging-0.1.8 → liblogging-0.1.9}/liblogging.egg-info/zip-safe +0 -0
- {liblogging-0.1.8 → liblogging-0.1.9}/setup.cfg +0 -0
|
@@ -51,22 +51,18 @@ class LogCollector:
|
|
|
51
51
|
def collect(
|
|
52
52
|
self, send_kafka: bool = False, chat_env: str = "dev", use_default_process: bool = True
|
|
53
53
|
):
|
|
54
|
-
start_time = time.time()
|
|
55
54
|
while True:
|
|
56
55
|
try:
|
|
57
56
|
line = sys.stdin.readline().strip()
|
|
58
57
|
if not line:
|
|
59
58
|
continue
|
|
60
|
-
print(line)
|
|
61
|
-
print(round(time.time() - start_time, 3))
|
|
62
|
-
start_time = time.time()
|
|
63
59
|
try:
|
|
64
60
|
if use_default_process:
|
|
65
61
|
trace_id, message = process_message(line)
|
|
66
62
|
else:
|
|
67
63
|
message = json.loads(line)
|
|
68
64
|
trace_id = message.get("trace_id", "")
|
|
69
|
-
|
|
65
|
+
print(message)
|
|
70
66
|
if send_kafka and trace_id:
|
|
71
67
|
print(f"Sending kafka message. env:{chat_env}")
|
|
72
68
|
thread_pool_manager.submit(
|
|
@@ -78,8 +74,8 @@ class LogCollector:
|
|
|
78
74
|
key=trace_id,
|
|
79
75
|
source=message.get("message_source")
|
|
80
76
|
)
|
|
81
|
-
except ValueError
|
|
82
|
-
|
|
77
|
+
except ValueError:
|
|
78
|
+
print(line)
|
|
83
79
|
|
|
84
80
|
except EOFError:
|
|
85
81
|
print("End of input reached. Exiting...", file=sys.stderr)
|
|
@@ -18,7 +18,7 @@ if __name__ == '__main__':
|
|
|
18
18
|
'liblogging_collector = liblogging.sending.log_collector:main'
|
|
19
19
|
]
|
|
20
20
|
},
|
|
21
|
-
version='0.1.
|
|
21
|
+
version='0.1.9',
|
|
22
22
|
description='Utilities for logging and sending logs.',
|
|
23
23
|
long_description_content_type='text/markdown',
|
|
24
24
|
long_description=long_description,
|
|
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
|