liblogging 0.2.3__tar.gz → 0.2.4__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.2.3 → liblogging-0.2.4}/PKG-INFO +1 -1
- {liblogging-0.2.3 → liblogging-0.2.4}/liblogging/sending/log_collector.py +10 -7
- {liblogging-0.2.3 → liblogging-0.2.4}/liblogging.egg-info/PKG-INFO +1 -1
- {liblogging-0.2.3 → liblogging-0.2.4}/setup.py +1 -1
- {liblogging-0.2.3 → liblogging-0.2.4}/LICENSE +0 -0
- {liblogging-0.2.3 → liblogging-0.2.4}/README.md +0 -0
- {liblogging-0.2.3 → liblogging-0.2.4}/liblogging/__init__.py +0 -0
- {liblogging-0.2.3 → liblogging-0.2.4}/liblogging/collector/__init__.py +0 -0
- {liblogging-0.2.3 → liblogging-0.2.4}/liblogging/collector/mongo.py +0 -0
- {liblogging-0.2.3 → liblogging-0.2.4}/liblogging/logger.py +0 -0
- {liblogging-0.2.3 → liblogging-0.2.4}/liblogging/sending/__init__.py +0 -0
- {liblogging-0.2.3 → liblogging-0.2.4}/liblogging/sending/kafka_service.py +0 -0
- {liblogging-0.2.3 → liblogging-0.2.4}/liblogging/util.py +0 -0
- {liblogging-0.2.3 → liblogging-0.2.4}/liblogging.egg-info/SOURCES.txt +0 -0
- {liblogging-0.2.3 → liblogging-0.2.4}/liblogging.egg-info/dependency_links.txt +0 -0
- {liblogging-0.2.3 → liblogging-0.2.4}/liblogging.egg-info/entry_points.txt +0 -0
- {liblogging-0.2.3 → liblogging-0.2.4}/liblogging.egg-info/requires.txt +0 -0
- {liblogging-0.2.3 → liblogging-0.2.4}/liblogging.egg-info/top_level.txt +0 -0
- {liblogging-0.2.3 → liblogging-0.2.4}/liblogging.egg-info/zip-safe +0 -0
- {liblogging-0.2.3 → liblogging-0.2.4}/setup.cfg +0 -0
|
@@ -10,7 +10,6 @@ import json
|
|
|
10
10
|
from datetime import datetime
|
|
11
11
|
import time
|
|
12
12
|
|
|
13
|
-
from .kafka_service import KafkaServiceFactory
|
|
14
13
|
from ..util import split_trace_id, thread_pool_manager
|
|
15
14
|
|
|
16
15
|
|
|
@@ -26,11 +25,13 @@ def process_message(line):
|
|
|
26
25
|
trace_id = message.get("trace_id", "")
|
|
27
26
|
if trace_id:
|
|
28
27
|
_, chat_dict = split_trace_id(trace_id)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
# 新日志直接携带 uid/session_id/turn;旧日志仍可从复合 trace_id
|
|
29
|
+
# 中解析。显式传入的非空字段始终优先,避免被兼容逻辑覆盖。
|
|
30
|
+
for field in ("uid", "session_id", "turn"):
|
|
31
|
+
if message.get(field) in (None, ""):
|
|
32
|
+
legacy_value = chat_dict.get(field)
|
|
33
|
+
if legacy_value is not None and legacy_value != "":
|
|
34
|
+
message[field] = legacy_value
|
|
34
35
|
create_time = message.get("create_time")
|
|
35
36
|
message.update({"create_date": get_date_from_time(create_time)})
|
|
36
37
|
return trace_id, message
|
|
@@ -39,6 +40,8 @@ def process_message(line):
|
|
|
39
40
|
class LogCollector:
|
|
40
41
|
|
|
41
42
|
def __init__(self, args):
|
|
43
|
+
from .kafka_service import KafkaServiceFactory
|
|
44
|
+
|
|
42
45
|
start_time = time.time()
|
|
43
46
|
self.kafka_service = KafkaServiceFactory.create_kafka_service(
|
|
44
47
|
config_path=args.config_path,
|
|
@@ -110,4 +113,4 @@ def main():
|
|
|
110
113
|
|
|
111
114
|
|
|
112
115
|
if __name__ == "__main__":
|
|
113
|
-
raise SystemExit(main())
|
|
116
|
+
raise SystemExit(main())
|
|
@@ -20,7 +20,7 @@ if __name__ == '__main__':
|
|
|
20
20
|
"liblogging_mongo_collector = liblogging.collector.mongo:main"
|
|
21
21
|
]
|
|
22
22
|
},
|
|
23
|
-
version='0.2.
|
|
23
|
+
version='0.2.4',
|
|
24
24
|
description='Utilities for logging and sending logs.',
|
|
25
25
|
long_description_content_type='text/markdown',
|
|
26
26
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|