huace-aigc-auth-client 1.1.28__py3-none-any.whl → 1.1.29__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.
@@ -123,6 +123,12 @@ def setLogger(log):
123
123
  legacy_setLogger(log)
124
124
  except Exception as e:
125
125
  print(f"Failed to set logger for legacy_adapter module: {e}")
126
+
127
+ try:
128
+ from .api_stats_collector import setLogger as api_stats_setLogger
129
+ api_stats_setLogger(log)
130
+ except Exception as e:
131
+ print(f"Failed to set logger for api_stats_collector module: {e}")
126
132
 
127
133
  if _fastapi_available:
128
134
  try:
@@ -172,4 +178,4 @@ __all__ = [
172
178
  # 用户上下文
173
179
  "get_current_user",
174
180
  ]
175
- __version__ = "1.1.28"
181
+ __version__ = "1.1.29"
@@ -6,9 +6,13 @@ import time
6
6
  import queue
7
7
  import threading
8
8
  import requests
9
+ import logging
9
10
  from typing import Optional, Dict, Any, List
10
11
  from datetime import datetime
11
-
12
+ logger = logging.getLogger(__name__)
13
+ def setLogger(log):
14
+ global logger
15
+ logger = log
12
16
 
13
17
  class ApiStatsCollector:
14
18
  """接口统计收集器(异步队列方式)"""
@@ -45,6 +49,7 @@ class ApiStatsCollector:
45
49
  self.worker_thread = None
46
50
 
47
51
  if self.enabled:
52
+ logger.info("启动 ApiStatsCollector 统计收集器")
48
53
  self.start()
49
54
 
50
55
  def start(self):
@@ -142,6 +147,7 @@ class ApiStatsCollector:
142
147
  if not buffer:
143
148
  return
144
149
 
150
+ logger.info(f"提交 {len(buffer)} 条接口统计数据")
145
151
  try:
146
152
  # 按token分组
147
153
  token_groups: Dict[str, List[Dict[str, Any]]] = {}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: huace-aigc-auth-client
3
- Version: 1.1.28
3
+ Version: 1.1.29
4
4
  Summary: 华策AIGC Auth Client - 提供 Token 验证、用户信息获取、权限检查、旧系统接入等功能
5
5
  Author-email: Huace <support@huace.com>
6
6
  License: MIT
@@ -1,12 +1,12 @@
1
- huace_aigc_auth_client/__init__.py,sha256=nCpT58WU83NkEpdyMiq35t4Zd261cdp45N_07NRoisY,4630
2
- huace_aigc_auth_client/api_stats_collector.py,sha256=UCUu2CHWsJyiAM58-XLQtfxWK0fjZ8TTdw90gv_Gx04,10347
1
+ huace_aigc_auth_client/__init__.py,sha256=P062wMHHDRDU9vEvsYxGoWTq8BWX5tmoAriZ8L1a6TA,4857
2
+ huace_aigc_auth_client/api_stats_collector.py,sha256=AGbqRJyHvYwtchGq6BYe4Q9xwVU-xUNOMffnmLnleh8,10588
3
3
  huace_aigc_auth_client/legacy_adapter.py,sha256=TVCBAKejE2z2HQFsEwDW8LMiaIkXNfz3Mxv6_E-UJFY,24102
4
4
  huace_aigc_auth_client/sdk.py,sha256=49UrQnS96a_m-FM9KVSqmE8x4J-R4qpYsE4KgzasvFE,36742
5
5
  huace_aigc_auth_client/user_context.py,sha256=KzevYLsLv1hv8rlvRw83FT-HugeoBJSJ1Pi56iLWyTE,5592
6
6
  huace_aigc_auth_client/webhook.py,sha256=XQZYEbMoqIdqZWCGSTcedeDKJpDbUVSq5g08g-6Qucg,4124
7
7
  huace_aigc_auth_client/webhook_flask.py,sha256=Iosu4dBtRhQZM_ytn-bn82MpVsyOiV28FBnt7Tfh31U,7225
8
- huace_aigc_auth_client-1.1.28.dist-info/licenses/LICENSE,sha256=z7dgC7KljhBLNvKjN15391nMj3aLt0gbud8-Yf1F8EQ,1063
9
- huace_aigc_auth_client-1.1.28.dist-info/METADATA,sha256=9TkNkzidAbMP7nb2drl1FfSOAumh6ngs7ueiik40mnE,23629
10
- huace_aigc_auth_client-1.1.28.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
11
- huace_aigc_auth_client-1.1.28.dist-info/top_level.txt,sha256=kbv0nQ6PQ0JVneWPH7O2AbtlJnP7AjvFJ6JjM6ZEBxo,23
12
- huace_aigc_auth_client-1.1.28.dist-info/RECORD,,
8
+ huace_aigc_auth_client-1.1.29.dist-info/licenses/LICENSE,sha256=z7dgC7KljhBLNvKjN15391nMj3aLt0gbud8-Yf1F8EQ,1063
9
+ huace_aigc_auth_client-1.1.29.dist-info/METADATA,sha256=vA68_R9XfMBn3LTPABOpiIeYXXMHe0ArtmzLsupXm90,23629
10
+ huace_aigc_auth_client-1.1.29.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
11
+ huace_aigc_auth_client-1.1.29.dist-info/top_level.txt,sha256=kbv0nQ6PQ0JVneWPH7O2AbtlJnP7AjvFJ6JjM6ZEBxo,23
12
+ huace_aigc_auth_client-1.1.29.dist-info/RECORD,,