liblogging 0.1.10__tar.gz → 0.1.12__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: liblogging
3
- Version: 0.1.10
3
+ Version: 0.1.12
4
4
  Summary: Utilities for logging and sending logs.
5
5
  Home-page: https://github.com/XoriieInpottn/liblogging
6
6
  Author: xi
@@ -106,8 +106,10 @@ kafka 配置文件格式:
106
106
  python service 2>&1 | tee {log_file_path} | liblogging_collector --config-path {your_kafka_path} --ssl-cafile {your_ssl_cafile_path} --send-kafka
107
107
  ```
108
108
  tee {log_file_path} 可以将你的程序记录(输出+错误)重定向到文件中(可选)。
109
+
109
110
  [log_collector.py](liblogging/sending/log_collector.py)为`liblogging_collector`的源代码地址。
110
- `env_name`不指定的话,默认读取`os.environ.get("CHAT_ENV", "dev")`
111
+
112
+ `env_name`不指定的话,默认读取`os.environ.get("CHAT_ENV", "dev")`.
111
113
 
112
114
  ## 📋Example
113
115
  增加额外记录字段信息,以及搭配[libentry](https://github.com/XoriieInpottn/libentry)使用的样例见 [example](example)。
@@ -81,8 +81,10 @@ kafka 配置文件格式:
81
81
  python service 2>&1 | tee {log_file_path} | liblogging_collector --config-path {your_kafka_path} --ssl-cafile {your_ssl_cafile_path} --send-kafka
82
82
  ```
83
83
  tee {log_file_path} 可以将你的程序记录(输出+错误)重定向到文件中(可选)。
84
+
84
85
  [log_collector.py](liblogging/sending/log_collector.py)为`liblogging_collector`的源代码地址。
85
- `env_name`不指定的话,默认读取`os.environ.get("CHAT_ENV", "dev")`
86
+
87
+ `env_name`不指定的话,默认读取`os.environ.get("CHAT_ENV", "dev")`.
86
88
 
87
89
  ## 📋Example
88
90
  增加额外记录字段信息,以及搭配[libentry](https://github.com/XoriieInpottn/libentry)使用的样例见 [example](example)。
@@ -17,6 +17,7 @@ class KafkaService:
17
17
 
18
18
  def __init__(self, config):
19
19
  bootstrap_servers = config["bootstrap_servers"].split(",")
20
+ print(f"kafka config: {config}")
20
21
  self.producer = KafkaProducer(
21
22
  bootstrap_servers=bootstrap_servers,
22
23
  key_serializer=lambda k: json.dumps(k).encode(),
@@ -70,6 +71,7 @@ class KafkaServiceFactory:
70
71
  ):
71
72
  with open(config_path, 'r') as f:
72
73
  config = json.load(f)
74
+ kafka_config = config[cluster_name][env]
73
75
  if ssl_cafile:
74
- config["ssl_cafile"] = ssl_cafile
75
- return KafkaService(config[cluster_name][env])
76
+ kafka_config["ssl_cafile"] = ssl_cafile
77
+ return KafkaService(kafka_config)
@@ -58,7 +58,7 @@ def split_trace_id(trace_id: str, combine_symbol: str = "+") -> Tuple:
58
58
  if len(parts) == 3 or len(parts) == 4: # 包含时间戳时长度为4
59
59
  try:
60
60
  uid, session_id, turn = parts[:3]
61
- return trace_id, {"uid": uid, "session_id": session_id, "turn": turn}
61
+ return trace_id, {"uid": uid, "session_id": session_id, "turn": int(turn)}
62
62
  except ValueError:
63
63
  pass
64
64
  return trace_id, {}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: liblogging
3
- Version: 0.1.10
3
+ Version: 0.1.12
4
4
  Summary: Utilities for logging and sending logs.
5
5
  Home-page: https://github.com/XoriieInpottn/liblogging
6
6
  Author: xi
@@ -106,8 +106,10 @@ kafka 配置文件格式:
106
106
  python service 2>&1 | tee {log_file_path} | liblogging_collector --config-path {your_kafka_path} --ssl-cafile {your_ssl_cafile_path} --send-kafka
107
107
  ```
108
108
  tee {log_file_path} 可以将你的程序记录(输出+错误)重定向到文件中(可选)。
109
+
109
110
  [log_collector.py](liblogging/sending/log_collector.py)为`liblogging_collector`的源代码地址。
110
- `env_name`不指定的话,默认读取`os.environ.get("CHAT_ENV", "dev")`
111
+
112
+ `env_name`不指定的话,默认读取`os.environ.get("CHAT_ENV", "dev")`.
111
113
 
112
114
  ## 📋Example
113
115
  增加额外记录字段信息,以及搭配[libentry](https://github.com/XoriieInpottn/libentry)使用的样例见 [example](example)。
@@ -18,7 +18,7 @@ if __name__ == '__main__':
18
18
  'liblogging_collector = liblogging.sending.log_collector:main'
19
19
  ]
20
20
  },
21
- version='0.1.10',
21
+ version='0.1.12',
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